title: How to read images from directory, assemble them in <img src="">, and have flask return image?
body: <p>I have a directory full of images.  In one of my templates, I want to display these images</p>
  
  <p>GET template:</p>
  
  <pre><code>render_template("registration.html", images=images)
  </code></pre>
  
  <p>in template: (using image/{{image}} because url_for doesn't accept variables)</p>
  
  <pre><code>{% for image in images %}
      &lt;input  class="avatar" type = "radio" name = "avatar" value = "{{image}}"/&gt;&lt;img src = "image/{{image}}"/&gt;
  {% endfor %}
  </code></pre>
  
  <p>and in app.py</p>
  
  <pre><code>@app.route('/images/&lt;image&gt;')
  def images(image):
      return send_file('public/assets/thumbs'+image, mimetype='image/jpg')
  </code></pre>
  
  <p>(public/assets/thumbs is the directory images reside in) however, this fails completely.  Is there any tricks or hacks I can use to make this work?</p>