Change logic to determine viewer dimensions to be based on width.

This is a demo of what I proposed in gh-13.

Here are two demos. One for the simple case of a nested viewer in a div without a fixed height:

http://studyforrest.org/mod_t1w.html

and one for a viewer in kiosk mode that is loaded on click to replace a <img>

http://studyforrest.org/mod_t2w.html

This seem to work on both desktop big screen and small smartphone screens.