Minor fix in image I/O