In your code, do you have a reason to set
in reply to Re^4: Strawberry and IIS not playing well
in thread Strawberry and IIS not playing well
I expect that after that, CGI expects to see some kind of Image data, although I cannot imaging what.
The "normal" thing is to set the type to text/html, or let it default to that.
"By three methods we may learn wisdom: First, by reflection, which is noblest; Second, by imitation, which is easiest; and third by experience, which is the bitterest."