Let $S$ be a certain affine algebraic surface over $\mathbb{Q}$ such that it admits a regular map to $\mathbb{A}^2/\mathbb{Q}$. We show that any non-trivial torsion line bundle in the relative Picard group $Pic^0\left(S/\mathbb{A}^2\right)$ can be pulled back to ideal classes of quadratic fields whose order can be made sufficiently large. This gives an affirmative answer to a question raised by Agboola and Pappas, in case of affine algebraic surfaces. For a closed point $P\in \mathbb{A}^2/\mathbb{Q}$, we show that the cardinality of a subgroup of the Picard group of the fiber $S_P$ remains unchanged when $P$ varies over a Zarisky open subset in $\mathbb{A}^2$. We also show by constructing an element of odd order $n\geq 3$ in the class group of certain imaginary quadratic fields that the Picard group of $S_P$ has a subgroup isomorphic to $\mathbb{Z}/n\mathbb{Z}$.