fix endianness issue in writePNG() for big-endian machines and nativeRaster