Crystallographic, magnetic and magnetocaloric properties of GdMgX intermetallic phases (X = Al, Ga, In)