Fixed pagePosition to take account of margins