Suppose $X,Y$ are varieties, $Y$ is projective and $f: X \to Y$ is a locally trivial fibration with fibre $\mathbb{P}^1$. Then there exists an open covering $\{U_i\}_i$ of $Y$ such that $f^{-1}(U_i) \cong U_i \times \mathbb{P}^1$ for each $i$.
Question: why is $X$ a projective variety?