Just to clarify a number of points regarding that imbalance in containers and how the shipping lines try and solve the issue.
In the Far East to Europe trade the westbound leg is monopolised by 40ft containers largely because most of the goods shipped are light and bulky. The road weights in in the UK allow for example allow up to 44 tonnes so a 40ft container can be loaded to about 26500kgs, slightly more from the European Mainland. The largest movement of goods eastbound to the Far East is waste paper, plastic scrap and scrap metal with the first two moving eastbound in 40ft containers and the scrap metal moving in 20ft containers. As a result a 40ft container of scrap paper averages about 12.5 tonnes per twenty foot unit (Teu) whereas a 20ft will be loaded up to 28000kgs. This does allow the lines to load huge numbers of these 40ft containers as the average payload is roughly half that of a fully laden 20ft. Depending on the berthing window the ship is allowed to exchange containers, once the laden containers have been loaded the port will often load as many empties as they can so they can returned to Far East. Typically in Southampton at any one time there can be 20000 to 30000 teu of containers on the quay awaiting shipment and a large proportion will be empties.
The issue of road weights which are much lower in the USA also means that 40ft containers tend to be the standard unit in this trade rather than the 20ft. This is partly because the US road legislation is based on the distributed weight of the truck in comparison to it's length, which effectively favours longer containers because of the domestic use of 45ft and 53ft containers. Most of the shipping lines now operate global services so a container arriving say from Shanghai into the UK could be used to move cargo to the USA.
The other solution deployed by some shipping lines is to completely blank a sailing and load the ship entirely with empty containers and in the case of the Europe to Far East market this can also involve the ship sailing via the Cape instead of the Suez Canal which whilst it adds a week to the transit time, it saves a considerable amount of fees for the transiting the canal. Whilst this my seem odd, there is a huge benefit for the shipping line, because it means the empties are immediately available for loading once they are landed in the Far East and by closing these ships to freight paying traffic the shipping lines can manage capacity of prevent rates dropping by the huge over supply in capacity.