saves photos and makes entry in db