1. A computer-implemented method comprising: identifying, by one or more processors, a document stored on a server in a network; calculating, by one or more processors, position information indicating relative positions of images in the document, the position information providing an indication of horizontal and vertical distances between the images in the document, the horizontal and vertical distances corresponding to spatial distances between the images when the document is rendered and displayed on a display; constructing, by one or more processors, a histogram based on the horizontal and vertical distances between the images in the document; calculating, by one or more processors, a likelihood that the document includes an image gallery based on a peak value in the histogram; indicating, by one or more processors, that the document contains an image gallery or does not contain an image gallery based on the calculated likelihood; and in response to an indication that the document contains an image gallery, updating, by one or more processors, an index, stored in a memory, that references the document or a score of the document.