def classify_images_into_tiltgroups(tiltgroupList, fileList):
    """ Create a dictionary for each tilt group, e.g.
            {   "tilt_1" : [ "img1.mrc", ... ] ,
                "tilt_2" : [ "img2.mrc", ... ] ,
                ...
                "tilt_n" : [ "img3.mrc", ... ] ,
            }
    """
    classified_dictionary = {}
    ## initialize a dictionary structure
    n = 0
    for tilt in tiltgroupList:
        n += 1
        tilt_name = "tilt_%s" % n
        classified_dictionary[tilt_name] = []
    ## fill the dictionary with files based on matching tilt name
    for file in fileList:
        file_tilt_id = file.split("_")[3]
        ## match the file to the index of the tilt group list
        matching_tilt_group = tiltgroupList.index(file_tilt_id) + 1
        matching_tilt_group_name = "tilt_%s" % matching_tilt_group
        classified_dictionary[matching_tilt_group_name].append(file)
    return classified_dictionary