Move DB connection management somewhere more central
Full test coverage for modules/top_images/*