How to add classes and events to image in javascript using Gutenberg?

How to add classes and events to image in javascript using Gutenberg?