Image generation function included