update logic for index photos