image generation initial code