Look at the code below.
May be this is what you want.
The replace is case insensitive.
<?php
// someting with quotes and more than one space
$imgString[0]= '<img sRc="http://a.host.com/images/myimage1.gif" width="100" height="50"> ';
// without quotes
$imgString[1]= '<IMG sRc=http://a.host.com/images/myimage2.jpg width="100" height="50"> ';
//not an image
$imgString[2] ="a text , not an img, and doesn't have a src";
for ($i=0; $i<sizeof($imgString); $i++)
print("\n".eregi_replace('(<img[[:space:]]+src=[\'|"]?)./([/])','\1pictures/\2',$imgString[$i]));
?>