implement photo storing in db