from pathlib import Path


def image_file_path(instance, filename, ext='.jpg'):
    """Returns the path with modified file name for the image files.

    Args:
        instance (object): instance of the file being uploaded.
        filename (str): current name of the file.

    Returns:
        str: new file path.
    """
    folder = Path('profile_pics')
    user_id = Path(instance.user.username)
    return str(folder / user_id.with_suffix(ext))