#1972 - Make new split_filename helper function in legal_file.

- Added legal_file::split_filename function.
- Added unit tests for it.
- Revised gallery_task and Item_Model to use it.