Bug fix for image generation codebase