am 8deafd7e: Fix bugs in image.create tests and clean up code a bit

* commit '8deafd7e4dcdd401ebb39ea28eb4cfaa8e326135':
  Fix bugs in image.create tests and clean up code a bit