added sorting for pictures