Sorts media files and stores them in the specified way.