add negative test for writing non-uint8-uint16 images, closes #281

Improved the error message.
merge branch 'issue281' into devel