fixing the image generation