tiff: Return more meaningful error codes