Instead of forcibly taking the last 4 characters, it now finds the last extension separator (the period) and takes a substr of its location.
Instead of forcibly taking the last 4 characters, it now finds the last extension separator (the period) and takes a substr of its location.