isn't the alt_text here duplicate of https://github.com/phpbb/phpbb/pull/2229/files#diff-c4a89ebc14a8dd561ba742e24e328cbeR390 ?
Also this added the waiting-circle icon (which i dont really understand why it is needed at all)
This should not be an ajax call, just pure JS?