Google will retrieve images from web pages that contain the words you search for. The closeness of the words to the image on the page has something to do with it, so if there is an online erotic story about a “hot Irish man” next to a picture of a couple playing footsie, that is the image you’ll get.