Fix a few annoying issues with drag to resize.

It should now properly ignore clicks that are clearly meant for resizing,
and it shouldn't stick to the mouse when a resize is not intended.
Fix RES gallery interactions.

RES actually mutates the current image in place, which causes all kinds
of problems with gfycat, as it removes the <img> in favor of a video.

This commit fixes that by maintaining the <img> element in-place and
simply using CSS to add and remove its visibility when necessary.