Promoted some lua variable to global and tidied up wml_actions.flash_image()