Fix generating image class