Keep result_dir in image tests if a test fails

Makes/deletes directories for each unit test
Nicer output on failures by throwing an Exception instead of asserting a
string