add photo function store to database