title: Formatting a Streamfield image block
body: <p>I want to specify the HTML for each streamfield block with a for loop in my template. However, the image part is getting complaints, and I'm sure I'm not doing it the right way.</p>
  
  <blockquote>
    <p>Invalid block tag on line 15: 'image', expected 'elif', 'else' or 'endif'. Did you forget to register or load this tag?</p>
  </blockquote>
  
  <pre><code>{% extends "base.html" %}
  
  {% load wagtailcore_tags %}
  {% load wagtailuserbar %}
  {% block content %}
      &lt;h1&gt;{{page.title}}&lt;/h1&gt;
      &lt;small&gt;{{page.date}}&lt;/small&gt;
  
      {% for block in page.body %}
          {% if block.block_type == 'heading' %}
              &lt;h2&gt;{{ block.value }}&lt;/h2&gt;
          {% elif block.block_type == 'quote' %}
              &lt;blockquote class="blockquote text-center"&gt;&lt;p class="mb-0"&gt;{{ block.value }}&lt;/p&gt;&lt;/blockquote&gt;
          {% elif block.block_type == 'image' %}
              {% image block.value width-1200 class="img-fluid" alt="Responsive image" %}
          {% endif %}
      {% endfor %}
  
  {% endblock %}
  
  {% wagtailuserbar %}
  </code></pre>