Modify photos unless condition and loop through thumbnails and test