Widget image reorganize layout

Actually, it is not the widget itself that is responsible for the broad structure. That is determined when a sidebar is registered. The widget instance itself, for instance, only stores the title. The html around it (in your case currently <h2>...</h2>, which you want to change to <a><h2>...</h2></a>) is set at the sidebar registration stage.

Now, your problem is you only want to change this structure for one specific type of widget. Luckily you can do this at the render stage. If you look at the source of the rendering function, you see a couple of filters you can use. You are looking for this one:

$params = apply_filters( 'dynamic_sidebar_params', $params );

You could use it like this:

function wpse337107_add_link_to_widget_title ($params) {
  if ($params[widget_name] == 'media_image') { // check needed if this is the correct widget name
    $params[before_title] = '<a href="https://www.example.com><h2>"';
    $params[after_title] = '</h2></a>';
    }
  return $params;
  }
add_filter ('dynamic_sidebar_params','wpse337107_add_link_to_widget_title',10,1);

Note: code not tested, so probably buggy, but I hope you get the point.