Added support for sorting media (attachment-type posts). Requires a plugin for enabling media categories (tested with Enhanced Media Library).