cleanup image tests
fix pep8 and static code check recommendations