Galerkin approximation for optimal nonlinear filtering of infinite-dimensional linear systems