Rangers' second-choice goalkeeper Scott Gallacher has signed a two-year contract extension at the club.