Added sorting for media listing