Fixed adding photos to the database