Peterborough United have secured the signing of Gillingham midfielder Jack Payne on a loan deal until the end of the season.