Fixed bug when replacing photo with photo already existing in set.