fixed image creation bug