Fix image output bug.