5
While I respect Shine's extensive solution; if all you want to do is not show the images on the screen then I really do recommend just editing the template... it's MUCH simpler, and the rest of the stuff isn't really necessary (at least, not that I can see - let me know if I'm wrong)
anyways, I hope you can get the php working again,
Keith