Create thumbnails for photos. Read/write photos to database.