if(/\.(png|jpg|gif|tiff|svg|bmp|jpeg)$/i.test(link)) {
var img = document.createElement( "img" );
img.src = link;
img.onclick = function(){close_expando(pid);};
expando.querySelector('.expandotxt').appendChild(img);
gif links are loaded and injected as an <img> in the .expandotxt div block.
(post is archived)