Write image data to RAW file