Hi
Your problem is easily solved :-)
I have a similar application that streams objects from a database to the browser via php3... Have a graphic.php3 file that streams your gif data from the source file but place a line like:
header("Content-Type: $mimeType");
before the file is output (should be the first thing you send to the browser). This tells the browser 'it's a gif' and it will then be handled correctly!
Kind Regards
/Simon Inns
P.S. The mime type for gif is image/gif (you can specify other file types)