Fix page rotation for unloaded pages.

Fixes #3966