How to add classes to image fields set to Unlimited and a "rel" attribute to the  tag that wraps them
Don't you want to use a module like Views Slideshow: Dynamic Display Block to produce what you're looking for ?

If not you should create a specific template for your field using a name like field--field-name.tpl.php (Drupal 7 Template Suggestions), put it in you theme folder and customize it.

You can use theme_imagecache() if you're on Drupal 6 or theme_image_style() on Drupal 7.

$img = theme('image_style', 
             array('style_name' =&gt; 'thumbnail', 
                   'path' =&gt; $content['field_image'][0]['#item']['uri']
                  ));


Then you wrap your images in a using l():

$attributes = Array('rel' =&gt; 'rel_text');

echo l('yourpath', $img, array('html' =&gt; TRUE, $attributes));