Basically what's happening here is that you output some HTML
comments before you output the image which means your image file is invalid and so your internet browser doesn't know what to display and defaults to what you're seeing (a white box in the middle of your screen).
Additionally when you use header
you should ensure that you haven't already returned data!
If you check your source
in your browser you'll see something like...
<!--testing if image can be found-->
<!--<img src="img.jpeg">-->
ÿØÿàJFIFÿá‹rExifII*Àж..................................
...with the additioonal data continuing for some time!
If you remove the comments from your PHP file then it will work as intended; your (entire) file should look something like:
<?php
header("Content-type: image/jpeg");
readfile("img.jpeg");
Note: You may want to add additional headers RE content length etc. but these aren't strictly necessary for most browsers.