Enhance validation of filename respectively replacement of invalid characters