If your problem does not involce security and it is just for presentation you can add the functions to volt, like Wojciech suggested:
$compiler->addFunction('strtolower', 'strtolower');
$compiler->addFunction('substr', 'substr');
$compiler->addFunction('strrchr', 'strrchr');
However if you want to do things right and do not trust the filename itself, you should go with finfo
.