Convection and dynamo action in the earth's outer core with spatially non-uniform thermal stratification