add photos to db and emit socket event