A little bit of *motivation* (the question starts below the line): I am studying a proper, generically finite map of varieties $X \to Y$, with $X$ and $Y$ smooth. Since the map is proper, we can use the Stein factorization $X \to \hat{X} \to Y$. Since the composition is generically finite, $X \to \hat{X}$ is birational, and therefore a sequence of blowups. I am currently interested in the other map: $\hat{X} \to Y$. I would like to apply Casnati–Ekedahl's techniques from “Covers of algebraic varieties I” (Journal of alg. geom., 1996). For this, I need $\hat{X} \to Y$ to be Gorenstein. (Since $Y$ is Gorenstein (since it is smooth), this is equivalent with $\hat{X}$ being Gorenstein.) When is this true?

Specifically, in my case $X \to Y$ is the albanese morphism of a smooth projective surface: so $Y$ is an abelian surface, and I am in the situation that the albanese morphism is surjective.

Let $f \colon X \to Y$ be a proper map between two varieties $X$ and $Y$ over a field $k$. Assume $X$ and $Y$ are smooth (and proper, if you want).

Let $\pi \colon X \to \hat{X}$ and $\hat{f} \colon \hat{X} \to Y$ be the Stein factorization ($f = \hat{f} \circ \pi$). Of course, in general $\hat{X}$ is not smooth. However:

Q1:Does $\hat{X}$ have some other nice properties?

I am thinking in the direction of, e.g., Gorenstein or Cohen–Macaulay. If not, does it help if we assume a bit more on $f$? Or, alternatively:

Q2:Under what conditions is $\hat{X}$ Gorenstein?