class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
more info about the class
header('Content-type: image/png'); readfile($my_png_file);
header('Content-Length: '.filesize($my_png_file)); header('Content-Type: image/png'); print file_get_contents($my_png_file);
It seems that you have a problem of headers. Check what headers are being sent to Firefox (you can use LiveHTTPHeaders for that).
You can also try to first output an image to the browser without using the class itself. Code such as (here with PNG images):
or