How do I prove the following:
We work in SET.
If $(f_{i}:Y_{i} \rightarrow Y)_{i \in I}$ is a (final) episink, $f: X \rightarrow Y$, and $h_{i}: X_{i} \rightarrow Y_{i}$ are functions such that for each $i \in I$, the diagram
$\begin{array}[c]{ccc} X_{i}&\stackrel{h_{i}}{\rightarrow}&Y_{i}\\ \downarrow\scriptstyle{g_{i}}&&\downarrow\scriptstyle{f_ { i}}\\ X&\stackrel{f}{\rightarrow}&Y \end{array}$
is a pullback, then $(g_{i}: X_{i} \rightarrow X)_{i\in I}$ is a (final) episink.
I already know that 'episink' in SET means 'jointly surjective', so $Y = \bigcup_{i \in I}f_{i}(Y_{i}) = Y.$
So, why is $\bigcup_{i\in I}g_{i}(X_{i}) = X, $ and where exactly do I use the fact that de diagram is a pullback?