def order(name: str):
    """
    Extract index of image from my poor naming scheme
    :param name: name from which to extract index
    :return: index of name
    """
    if name.startswith('pred'):
        split = name.split('_')
        if len(str(split[-2])) > 10:  # New file format, -2 is hash
            return int(split[-3])
        return int(split[-2])
    split = name.split('_')
    x = split[-1].split('.')[0]
    return int(x)