def img_directory_path(instance, filename):
    """
    Method to return the custom filepath for each image uploaded in
    ``Knowledge``.
    """
    return '{0}/{1}'.format(str(instance.category), filename)