tiff and xbm updates

Normal flow is to return image, but if error occurs, there is no indication of failure.
Converted gallocs to mallocs, now does mem checks, now does file-input checks and cleanup if any error(s) encountered, then return NULL on exit.