<%include file="header.html" />

The images seem to have no common part. See below for a possible explanation.

${open(app.work_dir + 'stdout.txt', 'r').read()}
<%include file="footer.html" />