fix file beeing read and no image generated