ImageMagick change and integration into test harness; more refactoring