def parse_idx(img_name):
    """
    Simple helper function that takes an image name and return the index position of the image.
    """
    bk = 0

    #Find where the significant digit appears
    prefix = img_name.split('.')[0][3:]

    for idx,alpha in enumerate(prefix):
        if int(alpha) == 0:
            continue
        else:
            bk = idx
            break

    num = int(prefix[bk:]) - 1 #Since image names start from 1

    return num