Move image tests to core, add test for bad image dimensions