An electronic device comprising: a display; a memory configured to store an image file including image data which includes a plurality of objects and metadata; and a processor, wherein the metadata includes information about a plurality of areas corresponding to the plurality of objects, and identification information of the plurality of objects, and wherein the processor is configured to: receive a user input for searching for an image; output, from among the plurality of areas, a first area corresponding to a first object from among the plurality of objects as a thumbnail of the image file on the display if the user input corresponds to a first identification information and this first identification information is different from a second identification information; output, from among the plurality of areas, a second area corresponding to a second object from among the plurality of objects as the thumbnail of the image file on the display if the user input corresponds to the second identification information and this second identification information is different from the first identification information; and merge the first area and the second area into a merged area and output the merged area as the thumbnail of the image file on the display if the first identification information is the same as the second identification information and if the user input corresponds to the first identification information. a display; a memory configured to store an image file including image data which includes a plurality of objects and metadata; and a processor, wherein the metadata includes information about a plurality of areas corresponding to the plurality of objects, and identification information of the plurality of objects, and wherein the processor is configured to: receive a user input for searching for an image; output, from among the plurality of areas, a first area corresponding to a first object from among the plurality of objects as a thumbnail of the image file on the display if the user input corresponds to a first identification information and this first identification information is different from a second identification information; output, from among the plurality of areas, a second area corresponding to a second object from among the plurality of objects as the thumbnail of the image file on the display if the user input corresponds to the second identification information and this second identification information is different from the first identification information; and merge the first area and the second area into a merged area and output the merged area as the thumbnail of the image file on the display if the first identification information is the same as the second identification information and if the user input corresponds to the first identification information. receive a user input for searching for an image; output, from among the plurality of areas, a first area corresponding to a first object from among the plurality of objects as a thumbnail of the image file on the display if the user input corresponds to a first identification information and this first identification information is different from a second identification information; output, from among the plurality of areas, a second area corresponding to a second object from among the plurality of objects as the thumbnail of the image file on the display if the user input corresponds to the second identification information and this second identification information is different from the first identification information; and merge the first area and the second area into a merged area and output the merged area as the thumbnail of the image file on the display if the first identification information is the same as the second identification information and if the user input corresponds to the first identification information.