x86: image: cleanup before creating image