added sort to gallery