Thank you for this. Its has saved me months of development.
just one small request.
When adding multiple images, the order the images are at is not the order the images are displaying in the front end.
If you arrange the images then save, you need to refresh the admin page and then save again before the system takes the order in what the images are arranged at.