Re-implemented code to remember the view pager position.