imaging: Fix database schema