Why does the Insert button just spin when trying to insert images into a page?

Sometimes when you click the Insert button to insert an image into a page, the button changes to a spinning icon but the image is never inserted. The spinning icon in the Insert button is shown below.

This is caused by a bug in the module used to upload and insert images. This problem does not happen on newly uploaded images, but can happen on images that were uploaded during a previous edit of the page. There is no fix, but there is a simple (though not intuitive) workaround.

If this problem happens to you, just click the dark blue Upload button (even though you are not uploading a new image). This has the effect of resetting the form. Then try to insert the image again, and it will work.