1. A method comprising: by a computing device, determining, for each of a plurality of image elements, a pattern of positions based on a size and shape of the image element and a size of a position in a display grid, wherein the grid corresponds to specifications for a displayable region of a screen associated with the computing device, and wherein positions in the grid are identified by coordinates specifying a location along a vertical axis and a location along the horizontal axis, wherein the pattern of positions for each image element is a set of contiguous grid positions; by the computing device, determining unoccupied positions in the display grid; by the computing device, identifying a plurality of image elements that are candidates for placement within the grid; while at least one of the unoccupied positions and at least one of the candidate image elements exist: by the computing device, matching one of the candidate image elements to a set of the unoccupied positions based on the pattern of positions for the candidate image element, wherein the matched candidate image element is selected for matching based on a ranking of the candidate image element and based on one or more placement rules that establish an order for filling positions in the display grid using the ranked candidate images based on a directional path of placement with respect to a starting point in the display grid; and by the computing device, designating the positions in the set as occupied by the matched image element; and by the computing device, providing layout information to render the image elements in accordance with placement of each matched image element at the designated positions in the grid.