Custom classes for attachments

Just add the following code in functions.php file of your theme which will add your custom added classes to images when you will insert it into post editor.

function add_image_class($html, $id, $caption, $title, $align, $url, $size, $alt="" ){
$classes = get_post_meta( $id, 'classes', true );
if ( preg_match('/<img.*? class=".*?">/', $html) ) {
    $html = preg_replace('/(<img.*? class=".*?)(".*?>)/', '$1 ' . $classes . '$2', $html);
} else {
    $html = preg_replace('/(<img.*?)>/', '$1 class="' . $classes . '" >', $html);
}
return $html;
}
add_filter('image_send_to_editor','add_image_class',10,8);