Add jquery to do the layouting
Add layouting code to template
Make layouting take image dimensions from DOM