Added swipe to next image or video functionality