Fix crash in making png.