Two requests on wp_get_attachment_image function (Line 635 at media.php)
1) Please add one filter (wp_get_attachment_image) for this function before return $html;
2) Please check $src after list($src, $width, $height) = $image;
if $src is null or not a URL, please set $html to "";