Automatic detection of TID for image name.