Similar to the UI, the items should be sorted to make sure that those with a preview are shown first in the list.