SWC-856 Clean up code for the wiki's image editor