Loupiote posted an interesting fact about how Google Image search works in the Google Webmaster Help forum.
He asked why does Google show images he is simply linking to, off his site, as an image on his site when all he is doing is linking to the image. He is not even using the image source tag, he is only linking to the image.
This search result shows two images, the first is not on his site but rather he links to the image. The second is the image on his site.
If you look at the page on the site, you will see only the second image displaying.
So why is Google showing the first image as if it was on and discovered on loupiote.com? Gary Illyes from Google said because Google not only looks at the image source code but also link source code to index new pictures.
Provided we're allowed to, we may crawl and potentially index images regardless where we find them in case our algorithms detects that the image would be useful for the users. This includes images referenced in img tags the usual way and anchor tags, too.
Forum discussion at Google Webmaster Help.