If a preview object was passed to displayImage() this new code determines whether we can use that preview. It is more selective than the old code and rejects previews that have the wrong aspect ratio.  (Which is one of the reasons that some of the tests had to change.)