You may also try adding a Content-type header to the headers.
OOPS, sorry, you are already doing that, I'm a moron, never mind, I don't have any suggestions on this matter.
ah, but maybe I do:
header('Content-Type: image/unknown');
This looks bad. If it's a GIF, you want image/gif or jpg:
image/jpeg or PNG, image/png ... unknown may be causing you problems for rendering in the browser.