Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
// based on https://commons.wikimedia.org/wiki/User:JuTa/gallerySize.jsjQuery(document).ready(function(){if(typeofgallerySize==='undefined'){gallerySize=180;}varpattern=/^(.*\/)([1-9]+[0-9]*)(px[^\/]+)$/;vargalleries=document.getElementsByClassName('gallerybox');for(vari=0;i<galleries.length;++i){varimages=galleries[i].getElementsByTagName('img');for(varj=0;j<images.length;++j){varimg=images[j];varsrc=img.getAttribute('src');vare=pattern.exec(src);if(e){varp=img.parentNode;varimgN=document.createElement('img');imgN.setAttribute('src',e[1]+Math.round((gallerySize*Number(e[2]))/120)+e[3]);imgN.onerror=(function(imgN,img){returnfunction(){imgN.onerror='';imgN.parentNode.replaceChild(img,imgN);returnfalse;};})(imgN,img);for(;!p.classList.contains('gallerybox');p=p.parentNode){p.style.width='unset';}p.style.width=gallerySize+5+'px';img.parentNode.replaceChild(imgN,img);}}}});