How to add css using the Preprocess_image function?
Try this. 

function mytheme_preprocess_image(&amp;$variables) {
   if(isset($variables['style_name'])) {
    if($variables['style_name'] == 'image_style') // this is an image style used in drupal's image styles {
     $variables['class']['img-responsive'][] = "true";
  }
 }
}