uploading photo to server and saving to database