How did you get {$subcategory}?
Also you can use:
_{{$_subcategory_|var\_dump}}_
To see what do you have inside variable.
{$subcategory.media.path} looks right, but could be that you use array of categories instead of category instance and it will work for you like {$subcategory[0].media.path}