Fixes to imwrite and imshow

Some fixes to image.jl to allow writing images again.  Also uses "open" on OS X to show a .tiff image in Preview, and tries to pick a couple of sane options for image viewing on Linux.  The imshow changes borrow from Tim Holy's work.