Update image tags using entity metadata wrapper
You must pass in a node object as the second value, instead of a node ID.

$node = node_load($node_id);
$wrapper = entity_metadata_wrapper('node', $node, ['bundle' =&gt; 'hub_page']);


That might be your problem. Check out the docs: Entity metadata wrappers.