in reply to Images built on the fly do not display
I had a similar problem with a script to generate a JPEG image on the fly, and eventually realized that I was failing to provide the right HTTP header. Have you made sure to print an appropriate content-type header in your script?