fixed bug in image name matching