1. A non-transitory computer readable storage medium storing a computer readable program executable by a computer for causing the computer to perform an image classification program, the image classification program comprising: a first processing step of dividing an image into regions by using image information for detecting a plurality of defocus amounts corresponding to a plurality of focus detection regions for focusing within the divided regions, and calculating distance information based upon (i) an existence of focus detection regions within the divided regions, and (ii) the defocus amounts for each of the focus detection regions as feature values; a second processing step of performing clustering in a space defined by the feature values; and a third processing step of grouping images that correspond to feature values that have been divided by the clustering.