Apps ViewPager in Scrollview

Basically, I have a ScrollView with a few tables on, and in between the tables there is a ViewPager that is displaying images. The scrolling on these images (gallery style horizontally) is very choppy. I have done research and have established that this IS an issue when embedding a ViewPager in to a ScrollView. I have also found solutions: Android - HorizontalScrollView within ScrollView Touch Handling - Stack Overflow etc.

However, I am unsure how/where to implement the solution? Where should I add the class etc? Sorry, I'm very new to Android and am playing around with development.