def findpath(imgpaths, filename):
    """
    find the filename in filepaths 
    [[imagefolder][imagefile]]
    """
    diridx = 0
    while True:
        try:
            if filename + '.ppm' in imgpaths[diridx]:
                return imgpaths[diridx][0]
        except:
            return None
        diridx += 1
