How do I get a link to an image CCK in Drupal 7 in the node view?
You want to use the Drupal link function l()  for this.

  $link_html = l('some cool link text', $node-&gt;field_main_photo['und']['0']['uri'];


then you can either print that $link_html variable OR you can return it some other function will be rendering it.

Bonus:
You can replace the 'some cool link text' with the name of the file by using this:

$node-&gt;field_main_photo['und']['0']['filename']


So that would give us:

$link_html = l($node-&gt;field_main_photo['und']['0']['filename'], $node-&gt;field_main_photo['und']['0']['uri'];


Make sense?

Also... print_r() can often ve difficult to parse through. I recommend that you enable the DEVEL module and instead do the following:

dpm($node);


This will render the node on the page in a manner that you can click through and inspect each element and array and object. Even better, you can double click the value and the variable path to that value shows up for you to copy and paste into your code.

I hope this helps! :-)