You could do like this:
function image_tag_class($class) {
$class .= ' my-custom-class';
return $class;
}
add_filter('get_image_tag_class', 'image_tag_class' );
in case you wanna know more about actions and hooks.
Difference Between Filter and Action Hooks?
add_filter
add_action