im running an image hosting site, for large images it completely ruins page layout ,= , just like imageshack or imagevenue has ..large images come in their orignal size only when they are click on.
They are using a onLoad javascript function. Put that page in your gallery.php page: <script language="javascript"> var saveWidth = 0; function scaleImg(what){ what = document.getElementById(what); if (navigator.appName=="Netscape") winW = window.innerWidth; if (navigator.appName.indexOf("Microsoft")!=-1) winW = document.body.offsetWidth; if (what.width>(720) || saveWidth>(720)) { if (what.width==(720)) what.width=saveWidth; else { saveWidth = what.width; what.style.cursor = "pointer"; what.width=(720); } } } </script> Code (markup): and then, on the image tag(Your example: <img src="images/Rani%20Mukherjee-desibabesandhunks.blogspot.com-5234.jpg"> Code (markup): , after src="..." add id="thepic" onClick="scaleImg('thepic')" onLoad="scaleImg('thepic')" Code (markup): and you'll have the same facility as imagevenue. so, you should have something like that in that file: <img src="{YOUR_FILE_LOCATION}" id="thepic" onClick="scaleImg('thepic')" onLoad="scaleImg('thepic')"> Code (markup): Enjoy