backend photo-delete function