MATLAB: How to know image is uint16 or uint8 automatically by code

image propertyuint16uint8

Currently I am working to develop an algorithm to process images which can be type uint16 or uint8. Does image have built in function to tell which is which? The image can be all black so max value can be < 255 even for uint16 so cannot use the max value to tell.
Thanks.