download returns number of pages