From the line you give us here localhost/MyWebsite/img1.jpg
I understand that you run your site with the web server of the visual studio, that is use a different port than the default 80.
So what I expect to see there was something like localhost:8080/MyWebsite/img1.jpg
, with the port, so, with out the port is probably call something else that ether not exist, ether not the same web as you work - and that's the reason of your error.