A few fixes to image creation.