added support for a weak database check (uses image_file as the primary key)