Fixed read/write of pixels in little endian