write pages and set photos