Using theme_preprocess_node i'm trying to add a class to all images on the page My code below is not working and i'm not sure why. I've tried a few variants.
according to the KPR variables output, the image I'm trying to access is here.

$variables['field_about_image'][0]

i think the 0 signifies it is the first (and only in this case) image on the page w/ the machine field name 'field_about_image'. so i wrote my code as:

function myTheme_preprocess_node(&amp;$variables){
    if($variables['type']=='basic_page_with_pic') {
echo '&lt;script&gt;alert("my func running")&lt;/script&gt;'; //Verified it's working
    $variables['field_about_image'][0]['class'] = 'myclass;
}
}


i've also tried this, just to get a class attribute added        

$variables['field_about_image'][0][] = 'class';


also the title attribute comes up as empty. so just as an execrcise i tried this.

$variables['field_about_image'][0]['title'] = 'some title;


any help on how to do this would be greatly appreciated!
From what I can tell, hook_preprocess_node() won't let you add both classes and title attributes to images from image fields. Try using hook_preprocess_field() as in the example below:

function myTheme_preprocess_field(&amp;$variables) {
  if (($variables['element']['#field_name'] == 'field_about_image') &amp;&amp; ($variables['element']['#bundle'] == 'basic_page_with_pic')) {
    $variables['items'][0]['#item']['title'] = t('This is the title text that will display when hovering.');
    $variables['items'][0]['#item']['attributes']['class'][] = 'class1';
    $variables['items'][0]['#item']['attributes']['class'][] = 'class2';
  }
}


Be sure to clear your cache.