Fix image handle creation.