Gallagher homers twice in victory