added sorting direction for the lightbox template