Implement the swipe feature for the image preview