def get_posted_files(db):
    """
    Extracts a set of image file names for persisted tweets.

    The application's expected image file format is ``an-image-name-without-the-path.png``. So,
    it does not include the path to the image file in the saved string.

    Args:
        db: TinyDB instance.

    Returns:
        set
    """
    posted_files = set()
    all_tweets = db.all()
    for tweet in all_tweets:
        posted_files.add(tweet['image'])
    return posted_files