Change sort algorithm for image.