If $Y$ is an algebraic stack over a scheme $S$ and $X$ is a stack such that there exists an $S$-morphism $X\to Y$ representable by algebraic spaces, then is $X$ an algebraic stack (in the sense that its diagonal is representable, and that it admits a smooth presentation)?

My guess is that this is quite obvious (by simply pulling-back the smooth presentation and consideration of some Cartesian diagrams involving diagonals). I just wanted to be sure I'm not missing any subtleties.