programmatically save image to node with link in custom module
The file field will handle the display of the file regarding to its settings in the FieldUI.

So referencing the fid is sufficient:

$node1-&gt;field_top_banner['und'][0]['fid'] = $file_temp_top-&gt;fid;