Change determination extension associated files

Normally determine extension by finding first . approaching from right.
For associated files use length of media_file basename to
determine the extension (approach from left).
Merge pull request #693 from itofzo/add_multidot_extenstions_dev

Change determination extension associated files