Gestalt Formation in a Competitive Layered Neural Architecture