I'm a PHP newbie, so I can't give you specifics, but I have done this same trick with ColdFusion (switching the header content-type and forcing a download). Forgive me if I say anything obvious.
In my experience there are two gotchas for getting this to work reliably, for any file, on any platform:
1) The content-type is important. The more specific you can be, the better. In your case you are sending images, but the content-type you are using is octet-stream. You could try one of the image content-types instead. I don't have them in front of me, but there are cheat sheets for all content types available out there.
2) Some browser/platform mixes like to see a file name in the URL. Specifically, as the last item in the URL. I forget which particular combination of browser and platform requires this, but I usually make it a habbit to add a dummy &filename=some_file.ext at the end of URL I am using to serve up the file I am generating.
HTH
--Hardy