Improve performances of image generation