Fix image file creation