Steve Shaw:
We do not want the images as zip files - they need to be seen within the page they are posted to.
(I actually don't understand that comment - am I missing something?)
I was meaning that on our forum, if you provide the PHP code, you could zip it and upload as a file. Not to post the code directly.
Anyway, I must say sorry 'cause I don't remember what your task was about. How many years ago it was done? I couldn't be sure. But you could definitely try to uncomment the code I've mentioned, and check your issues incl. that customized approach. If it won't work, then something else needs to be tried out.