I am trying to see if we can have custom Show batch that can also give Image ids along with its labels , upon back tracing it m not sure where is place where one can record ids of image items fetched for show batch which then can be passed along with labels to same .
you could try changing you labeling function to include the file name/Image id too.
def is_cat(x): return (str(x[0].isupper())+ str(x))
dls = ImageDataLoaders.from_name_func(
path, get_image_files(path), valid_pct=0.2, seed=42,
label_func=is_cat, item_tfms=Resize(224))
.Not sure if this is what you are referring too.