fixes and cleanup for create-image (thx magnificrab)