First, I think you are mixing the image key and binary image data.
Template
You must write the image key (string) to your template:
<img src="/disp?key={{image_key}}" />
i.e. your last html should look like this if you just pass image.key () to your template:
<img src="/disp?key=AC3CK3333KCCK2K213" />
. . html . .
(Btw, , html- <img ... /> <img ...></img>, <img .../></img>)
disp_image . , , , "/static/unknown.gif", gif.
else:
self.response.headers['Content-Type'] = "image/png"
return self.response.out.write("/static/unknown.gif")
unknown.gif , , "/static/unknown.gif" url "/disp?key=..."
, , , <domain>/disp?key=... URL , .