Fix capturePage API, closes #847