MDL-43089, fixed and add unittest to repaginate