Fix image resize and move while the image is loading

This fixes a couple issues with resizing or moving an image that is still loading (notably gifs):
Resizing now doesn't create an empty space under the image.
Moving is no longer bounded by the container.
Keyboard shortcuts now works.