Unsupervised Learning of Hierarchical Spatial Structures In Images