Script edited to allow comparison for image already in the page