Try with this function:
function catch_image($post_id) {
$first_img = '';
ob_start();
ob_end_clean();
$related_post = get_post($post_id);
$content = $related_post->post_content;
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $content, $matches);
$first_img = $matches[1][0];
if(empty($first_img)) {
$first_img = "url for noimage.jpg";
}
return $first_img;
}