1. An information processing apparatus comprising: clustering means for performing clustering on multiple images so as to more strongly connect the images at a closer distance based on distances determined by metadata of the images; grouping means for grouping the images such that a number of images of each group can be equal to or lower than a predetermined number of images in accordance with a strength of connection among the images; the metadata describes shot times when the images are shot, the distance refers to a time interval between the shot times, the clustering means performs clustering on the images by connecting the images in a binary tree structure so as to reduce a number of nodes among the images with smaller time intervals between the shot times based on the shot times when the images are shot, and the grouping means groups the images by dividing the binary tree to which the images are connected into subtrees to which a predetermined or smaller number of images are connected; and correcting means for correcting the numbers of images contained in adjacent subtrees of the divided subtrees when the numbers of images, which are shot within a predetermined time range and are contained in the adjacent subtrees, are unbalanced.