Fix bug which does not generate valid image files during the generation process.