sort data by date and loading image