Extend reverse filename logic