Gatan DM3: add bounds checking and allow endian swapping for uint values

Fixes #12182.