use jQuery,jquerymobile,auto adjust column ,3/2/1,compatible with ie7+. check the demo for detail & source code.
vertical layout:
/demo/picroll/picroll.html
horizontal:
/demo/picroll/picroll2.html