Three-dimensional structures in nominally two-dimensional cavity flows