Recode and rescale texture file data before uploading

A recodeImage() method is added to the JavaScript ArrayBuffer object.