Here's a well hidden issue (and I blame nobody but myself):
I was writing what really is a very simple PHP script to grab a file from the server and download the file via a link. No matter what I did I kept getting an error from Firefox that politely informed me that it couldn't render the image due to internal errors.
I quite accidentally tripped across the cause .... somehow I had saved a file as UTF-8 encoded instead of ASCII!
My favorite programmer's editor, UltraEdit, has an easy to use shortcut key combination (ctrl-H) that allows me to switch between regular text and hexidecimal representation views - and thankfully I accidentally hit that very combo while trying to trouble shoot.
The site relied on a class I name 'SiteInitialize' (I like originality), and this class was self-contained in its own file. Here's what I saw when I looked at the file in hexidecimal view - note the hilited bytes and text and the three bytes that preceed the hilite in the hex view:

I immediately saw my problem. PHP was pulling in the class definition file, and then PHP was doing what it always does: PHP was simply spitting out anything that wasn't between script tags. That meant those leading three bytes were being sent to the output stream, and the web browser was seeing those as the first three bytes of the image file I was trying to download - resulting in Firefox correctly telling me that the file appears to have been corrupted.
What made this hard to find is the fact that those three bytes identifying the file as UTF-8 encoded shouldn't and don't appear in the normal view:

The solution was an elegantly simple act of saving the file as ASCII. Once that was done the lead three bytes disappeared - note the hilited bytes and text:

As expected the browser was able to properly decode and display the image.
Just something to keep in mind.