strip()
function strip() {
  for (var i=0;i<g_questions;i++) {
    document.write("<img id='e"+i+"'>");
  }
}

Notice that I have used e0, e1, ... for the id's since we have already used 0, 1, ... in the answers div.

So now we can write finale().

function finale() {
  Hide('main');
  Show('end');
  for (var i=0;i<g_questions;i++) {
    var el=document.getElementById('e'+i);
    el.src=g_dir+'/'+g_used[i]+'.jpg';
  }
}

Try it and you will spot a couple of issues.

First, the space where main is, remains. That is because it is still there, just not visible. We have to be more heavy-handed and do this:

function finale() {
  var el=document.getElementById('main');
  el.style.display='none';
  Show('end');
  ...
}