Gadi Evron wrote:
 > The jpeg is actually an HTML file, and when the web browser receives it,
 > it thinks that it is a server error message for the file not existing,
 > and loads the page.

Not necessarily. Often it is just a directory named xyz.jpg. The browser 
then
gets redirected to /url/xyz.jpg/ and loads the index.html there.

-Andreas