Dynamic Image Links Depending on Excerpt/’Single Post’ View

If I understand it correctly, in you index.php you want to link the image to the full post. You can accomplish that by adding this to your index.php:

<a href="https://wordpress.stackexchange.com/questions/24537/<?php the_permalink() ?>" alt="<?php _e('Read full article', 'theme');?>" title="<?php _e('Read full article', 'theme');?>"><?php the_post_thumbnail('name-thumb'); ?></a>

assuming that you use the featured image to show the image on the index page

And in the full post (i.e. on single.php) you want the link to go to an external link.
To accomplish this, I think you’d best add the external link during the image upload, where it says “image links to”.