Sanitizing filename. More generic approach