Well, I would probably use [man]preg_replace_callback/man like so:
$pattern = '/\[img:(.*?),.*?\]/i';
$string = 'This is my text [img:Blue hills.jpg,align=,width=700,height=525,vspace=0,hspace=0,border=1] it contains many [img:rings.jpg,align=,width=400,height=325,vspace=0,hspace=0,border=1] i want to delete it';
$image = array();
$string = preg_replace_callback(
$pattern,
create_function('$matches', 'global $image; $image[] = $matches[1]; return NULL;'),
$string
);
echo $string; // This is my text it contains many i want to delete it
print_r($image); // Array ( [0] => Blue hills.jpg [1] => rings.jpg )