Let $X$ be a normal projective (or, quasi-projective) variety over $\mathbb{C}$. Let $U \subset X$ be an open subscheme whose complement $Z = X \setminus U$ has codimension at least $2$ in $X$. Let $L$ be a line bundle on $U$. Is it possible to extend $L$ to a line bundle $\widetilde{L}$ on $X$ such that $\widetilde{L}\vert_U \cong L$?
Edit: If this is true, can we get $\textrm{Pic}(X) \cong \textrm{Pic}(U)$?