def get_filenames(img_dir):
    """
    Gets all the filenames in the image directory.
    
    :param img_dir: ('PosixPath' object) path to image directory
    :return: (list) list of filenames in the image directory
    """
    all_filenames = []
    if img_dir.is_dir():
        all_filenames += [item for item in img_dir.iterdir() if ".ipynb_checkpoints" not in str(item)]
    return all_filenames