optimize the image list.