Add support for multiple category templates, fix batch upload errors