Move gallery info to the database.