how are you calling each file? going directly to it, or calling it in an <IMG tag?
if it's sending out random chars, that'll be the image data - it's just that the header isn't being sent to the browser properly
all files are send with a header called Content-Type, with values such as text/html, image/gif etc etc and you need to send this for the browser to know that it's a file, not a stream of text.