Fix Issue #80 that crashed ranger when resized too small

This fixes Issue #80 and cleans up the code a bit so this particular
fragment is more readable.
ext.img_display: allow using W3MIMGDISPLAY_PATH env var

in response to https://savannah.nongnu.org/bugs/?38582