Scale image to window width or height.

I have often several erc windows open and so they can become quite small (for images). If a image gets inserted inline it is barely viewable if not rescaled.

This commit adds an option to rescale the image to width or height (whatever is smaller) to make it viewable at least in a "preview" sort of way.