def filter_by_tag_name(qs, name):
    """
    Filters the queryset by tag name, the lookup is case-insensitive.
    Ensure that only documents that can be included are included (no zipped
    documents). All image types are automatically converted to pdf, so checking
    for ".pdf" extension should be sufficient.
    """
    return filter(lambda x: x.filename.endswith('.pdf'), qs.tag_names(name))