Theory of cross-correlation analysis of PIV images