added saving to db
getting data from mongodb for gallery