added code for pages, and images