Create a method to extract extension from filename