1. An image processing apparatus comprising: an input unit which inputs a contents data group including at least a video image; a first reference image number determination unit which determines a first reference image number which is a provisional number of reference images including thumbnail images and icons, the reference images corresponding to the contents data group inputted from the input unit; a margin amount calculating unit which calculates an amount of a margin to be left in a predetermined output area, in case where the first reference image number of reference images corresponding to the contents data group are arranged in the predetermined output area, the first reference image number determined by the first reference image number determination unit; a second reference image number determination unit which determines a number of the reference images to be added to the first reference image number based on the amount of the margin calculated by the margin amount calculating unit, and then determines a second reference image number which is a final number of the reference images corresponding to the contents data group equal to the first reference image number plus the number of reference images to be added; and an extracting unit which extracts a number of still images equivalent to the second reference image number from a video image included in the contents data group inputted by the input unit.