Add a div with ID imgDiv and make your script
document.getElementById('imgDiv').innerHTML='<img src=\'http://webpage.com/images/'+document.getElementById('imagename').value +'.png\'>'
I tried to stay as close to your original as tp not overwhelm you with jQuery and such