Here is the code I used.
//function content_magic($content) {
//
//$content = get_the_content();
//
//$m= preg_match_all('!http://[a-z0-9\-\.\/]+\.(?:jpe?g|png|gif)!Ui' , $content , $matches);
//
//
//if ($m) {
// $links=$matches[0];
// for ($j=0;$j<$m;$j++) {
// $content=str_replace($links[$j],'<img src="'.$links[$j].'">',$content);
// }
//}
//
//
//
// return $content;
// }
This worked on another theme, but then my Video URLs would not automatically be turned into videos.