avoids searching for the image twice