Fix bug with photo getting deleted when shouldn't be