1. A non transitory computer-readable storage medium storing an image processing program that causes a computer to execute a process comprising: acquiring the same object identification information included in a plurality of image data items by referring to a storage unit that stores each of the image data items, object identification information that identifies an object included in the image data item, and a location information item that identifies a location of the object in the image data item in association with one another; acquiring the location of the object identified by the acquired object identification information in each of the image data items by referring to the storage unit; computing a difference between the acquired location information items; comparing the difference between the location information items with a predetermined location threshold value; determining whether the image data items are to be in the same group on the basis of a result of comparison of the difference between the location information items and the predetermined location threshold value; referring to correspondence information that is further stored in the storage unit and that indicates a correspondence between event identification information for identifying an event and background object identification information for identifying an object that indicates a situation of the image data item and that is included in the image data item indicating the event to identify the background object identification information that is coincident with the acquired object identification information; acquiring event identification information stored in the storage unit in association with the identified background object identification information; and storing, in the storage unit, the plurality of image data items that are determined to be in the same group in the determining whether the image data items are to be in the same group in association with the acquired event identification information.