Fix a fatal error when the Page image doesn't exit

Improve code of the addition of pref and next links to Page: pages
Use the same order as the old interface

Change-Id: I9df4eac6252b59736b1080e15d0cabf759547f2c