json_typeof function.

Andrew Tipton.
Fix bug in record_image_ops on big endian machines.

The buildfarm pointed out the problem.

Fix based on suggestion by Robert Haas.