Set database structure for gallery