Well... I would say you can use [man]preg_match_all/man to match all of the image sources, and then use a function like [man]basename/man to just get the filename part... like so:
$pattern = '/<img.*src\s*=\s*["\'](.*)["\'].*>/Usi';
preg_match_all($pattern, $data, $matches);
$files = array_map('basename', $matches[1]);