Oil prices gain as dollar weakens with dovish Fed