A computer-implemented image processing method comprising: a setting step of setting a number of images to be arranged as a layout image in a display window for display; an acquisition step of acquiring an image data group including a plurality of images, a score for a main slot for each image of the image data group, and a score for a sub-slot for each image of the image data group; an identifying step of identifying, based on photographing date and time of each image of the image data group acquired in the acquisition step, a photographing period of the acquired image data group; a first selection step of selecting images for including in the layout image, the first selection step comprises selecting an image with a highest score for a main slot from the acquired image data group corresponding to the identified photographing period; and a generation step of generating the layout image by arranging the selected images in the display window for display, wherein the first selection step comprises performing: i) a dividing step of dividing the identified photographing period into a plurality of equal photographing sections including a section containing said selected image and an unselected photographing section not containing a selected image, ii) a subsequent selection step of selecting another image with a highest score for a sub-slot from an image data group, in the acquired image data group, corresponding to an unselected photographing section of the plurality of photographing sections, and iii) updating the total number of selected images to an updated total number of selected images, by the selection of another image from the image data group corresponding to the unselected photographing section, in a case where the updated total number of selected images is smaller than the number of images in the setting step, steps i) to iii) are repeated until the updated total number of selected images is equal to the number of images set in the setting step, wherein each subsequent dividing step is configured to divide the photographing sections formed in the previous dividing step, wherein the main slot is a largest slot in a template on which the images are arranged, and a sub-slot is a slot different from the main slot in the template. a setting step of setting a number of images to be arranged as a layout image in a display window for display; an acquisition step of acquiring an image data group including a plurality of images, a score for a main slot for each image of the image data group, and a score for a sub-slot for each image of the image data group; an identifying step of identifying, based on photographing date and time of each image of the image data group acquired in the acquisition step, a photographing period of the acquired image data group; a first selection step of selecting images for including in the layout image, the first selection step comprises selecting an image with a highest score for a main slot from the acquired image data group corresponding to the identified photographing period; and a generation step of generating the layout image by arranging the selected images in the display window for display, wherein the first selection step comprises performing: i) a dividing step of dividing the identified photographing period into a plurality of equal photographing sections including a section containing said selected image and an unselected photographing section not containing a selected image, ii) a subsequent selection step of selecting another image with a highest score for a sub-slot from an image data group, in the acquired image data group, corresponding to an unselected photographing section of the plurality of photographing sections, and iii) updating the total number of selected images to an updated total number of selected images, by the selection of another image from the image data group corresponding to the unselected photographing section, i) a dividing step of dividing the identified photographing period into a plurality of equal photographing sections including a section containing said selected image and an unselected photographing section not containing a selected image, ii) a subsequent selection step of selecting another image with a highest score for a sub-slot from an image data group, in the acquired image data group, corresponding to an unselected photographing section of the plurality of photographing sections, and iii) updating the total number of selected images to an updated total number of selected images, by the selection of another image from the image data group corresponding to the unselected photographing section, in a case where the updated total number of selected images is smaller than the number of images in the setting step, steps i) to iii) are repeated until the updated total number of selected images is equal to the number of images set in the setting step, wherein each subsequent dividing step is configured to divide the photographing sections formed in the previous dividing step, wherein the main slot is a largest slot in a template on which the images are arranged, and a sub-slot is a slot different from the main slot in the template.