Finished add function, genreting pages and thumbnails now