delete pages and optimize the folder