It's really rather obvious when you think about it. Your jpeg file would not normally comtain any html would it? just jpeg file data.
With that being the case, why are you printing the file into your html? - how will the browser know that it is supposed to be displayed as an image?
Every time a browser disp;ays a webpage it reads the source for <img> tags and downloads the file from the server seperately. That is where php should be using this header and outputting the file stream, in a seperate php file addressed in the img tag.
My helpful sig has gone because a mod below the administrator gave me an infraction - despite the administrator personally agreeing to it.
If you need any php tips or tricks you can PM me.