I think you missed a pair of quotes here :
Code:
.
.
	else
	{
	    tbl.innerHTML="<img src=../../temp/"+name1+".png>";
		tbl.style.display = 'block';
 	
	}
.
.
Try changing it to : tbl.innerHTML="<img src=\"../../temp/"+name1+".png\">";