diff --git a/pygeoapi/templates/item.html b/pygeoapi/templates/item.html
index 1590922..390cac8 100644
--- a/pygeoapi/templates/item.html
+++ b/pygeoapi/templates/item.html
@@ -2,9 +2,7 @@
{# Optionally renders an img element, otherwise standard value or link rendering #}
{% macro render_item_value(v, width) -%}
{% set val = v | string | trim | lower %}
- {% if val|length and
- (val.endswith(".jpg") or val.endswith(".jpeg") or val.endswith(".png") or val.endswith(".gif") or val.endswith(".bmp"))
- %}
+ {% if val|length and val.endswith(('.jpg', '.jpeg', '.png', '.gif', '.bmp')) %}
{# Ends with image extension: render img element with link to image #}
{% else %}