Fix duplicate or missing photos.