updated determineLayout, restore check
Merge branch 'render-refactor' of github.com:futurepress/epub.js into render-refactor