def CmpThumb(first, second):
    """ Compares two thumbs in terms of file names and ids. """
    
    if first.GetFileName() < second.GetFileName():
        return -1
    elif first.GetFileName() == second.GetFileName():
        return first.GetId() - second.GetId()
    
    return 1