speed up finding the image under mouse

the program now starts with the images on the top -> the loop can stop
after the first match