An extension of the interacting boson model and its application to the even-even Gd isotopes