Adding a Monadic image generation function