That code just check whether your server has some settings that can't generate images.
Now I think there's should be another problem that broke the images .
Can you send me an URL for checking it ?
If you don't want send URL to the forum , you can send it to my mail box terry @ cutesoft.net
Regards , Terry .