modify to detect svg image too