Thank you for the interesting theory.
The error was generated only on the index page and interestingly enough vanished when I changed to single cat level. Also if you jumped straight to a cat rather than open the index page there was no error. I do accept that there could well be another plugin that could be playing up.
I'll look into this a little more and if I do find the culprit I will post the details here.
I have about 50 cats and possibly about 600 subcats all showing on the index page.
Anyway for now I have increased the php memory as I am working on the gallery, but later I will reduce the memory down to so 40mb as I feel that should be more than ample to cope with the gallery.