Right. Didn't see that. My bad. However, you should try putting an exit; after that echo, and remove the ?> sign from the end. That way, you're making sure that nothing after that point will be sent to the browser. And, you should use the same content type the image had before inserting it into the database. You're probably doing that already, I assume.
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
I'm using image/foo.
It is stored in the database for that particular image so that it always has the right type. I know it's selecting the right content-type also because if I echo out the type instead, i get image/jpeg for a jpeg image and the same with png.
It worked on zymic.com's servers, but not 1and1.com's so it puzzles me.
"We are told never to cross a bridge until we come to it, but this world is owned by men who have 'crossed bridges' in their imagination far ahead of the crowd."