Add lazy loading images and grid layout in rows to images
This adds lazy loading to images from queries so they do not all load at
the same time, which is very slow and a bad user experiance for large
queries. This also imrpoves the layout and arranges the images in order.
The heights of images must be inform within a row so that they
do not staggar at the bottom.