fixes double image generation