Crystal structure and multiferroic properties of Gd-substituted BiFeO3