Small bugfix to upload_pages