He says,
"When a browser requests a file from a HTTP server, the server response includes info on what exactly it contains. These bits of info are called headers. The headers usually include infor on the type of data being sent, the size of the response, and in the case of files, the name of the file."
...
...
We start simply by reading the ID sent by the link in phase 3. If the ID is valid, we fetch the information on the file who's ID we received, send the headers, and finally send the file data."
And this is how he is showing the image ....
- <a href='get_file.php?id={$row['id']}'>Download</a>
Note: get_file.php is another php file which does no HTML thing. It solely sends headers and the image in binary format.
So You should use two PHP files, 1 having HTML code (with img tag) and another just dumping the image with its headers. Something like this,
- <img src='get_file.php?id={$row['id']}'>