Changed write order of filesize, width, height, and array size

Big endian to little endian