Creating a custom image generator