the first pic is of a inverted V type engine. The inline and V engines were built becasue they offerd less frontal area for the aircraft than with a radial engine. Only problem with an inline or V engine is that the engine cowling had to be very tall and it obstructed the pilots view. So they turned them upside down and solved the problem.
The second pic is of the Pratt and Whitney Wasp Major engine,(28 cylinders, 4,360 cubic inch displacement, making 3500 horsepower) a 4 row radial engine with 7 cylinder per row. The reason for these monstrous piston engines was that at the time the jet engine was comming of age and beginning to see wide spread use in aviation. But big piston engines still had their place since they were much less expensive and eons more fuel efficent than a comperable turbine engine. The only reason piston engines lasted so long is that the power to weight ratio was able to be maintained at or near that of the early turbine engines.
I'm going to search for a site that is all about aviation history. IT has links that explain the theory of operation of the radial engine and how an inverted engine can run without having oiling problems.