For a generalization to pullback we have to proof that $colim_i X_i\times_{Y_i} B_i \cong X\times_YB$ (where $X, Y, B$ are the respective colimits). Because $I$ is filtred the triple diagonal $I\to I\times I\times I$ is final and we can make this colimit partially, then we can do the colimit in the $Y_i$ before.
Then we have to prove that $colim_i X_i\times_Y B_i \cong X\times_YB$ .
Then is enought show that the pullback of any colimit is still a colimit, and then with the some "soft proof" argumentations you done.
Is enought to show that:
give a $f: X\to Y$ and a cocone $B_i \to Y$ with $I$ a small category (no necessarly filtred), with a colimit $B_i\to B$ and the natural arrow $B\to Y$. Then the pullback with $f$: $B_i\times_Y X \to B\times_Y X$ is a colimit.
this is true if the pullbach funtor $(X, f)^\ast: \mathcal{C}\downarrow Y\to \mathcal{C}\downarrow X$ is a left adjoint, and then is cocomplete.
This is as said that $\mathcal{C}$ is locally-cartesian-closed.
This is true in any topos, and this property is a specific and profound aspect of topoi and their internal logic.
We can observe that in my above argomentation $I$ cannot need not be filtred, but for $I$ no filtred the diagonal $I\to I\times I$ could be no final.

