Use correct transition class list for removal

I had an issue where the transition classes weren't being removed correctly. Asking for them early before the current and next pages are changed seems to do the trick.