title: Why does this image not displaying (broken image icon)?
body: <p>I am trying to display an image that I saved to Datastore with <code>DisplayImage</code> handler below but I only see a broken image link. Do you know why? Thanks!</p>
  
  <pre><code>class HomePage(db.Model):
      thumbnail = db.BlobProperty()
      firm_name = db.StringProperty()
  ...
  
  class ImageUpload(webapp.RequestHandler):
      def get(self):
  ...        
          self.response.out.write("""
          &lt;form action="/imagesave" enctype="multipart/form-data" method="post"&gt;
          &lt;div&gt;&lt;label&gt;firm name:&lt;/label&gt; &lt;input type="text" name="firm_name" size=40&gt;&lt;/div&gt;
          &lt;div&gt;&lt;input type="file" name="img" /&gt;&lt;/div&gt;
          &lt;div&gt;&lt;input type="submit" value="Upload image"&gt;&lt;/div&gt;
          &lt;/form&gt;
          """)
  
  class ImageSave(webapp.RequestHandler):
     def post(self):
          homepage = HomePage()
          thumbnail = self.request.get("img")
          firm_name = self.request.get("firm_name")
          homepage.thumbnail = db.Blob(thumbnail)
          homepage.firm_name = firm_name
          homepage.put()
  
          self.redirect("/imageupload")
  
  class ImageResize(webapp.RequestHandler):
      def post(self):
          q = HomepageImage.all()
          q.filter("firm_name", "mta")
          qTable = q.get()
  
          if qTable:
              qTable.thumbnail = db.Blob(images.resize(self.request.get("img"), 32, 32))
              db.put(qTable)
          else:
              self.response.out.write("""firm not found""")
          self.redirect("/imageupload")
  
  class DisplayImage(webapp.RequestHandler):
      def get(self):       
          query = HomePage.all()
          query.filter("firm_name", "mta")
          result = query.get()
  
          self.response.out.write("""firm name: %s""" % result.firm_name)
  
          self.response.out.write("""&lt;img src="img?img_id=%s"&gt;&lt;/img&gt;""" %
          result.key())
  ...
  </code></pre>