Fix some issues with the image-select.js loading script.