Upload assets to location based on category if entry isn't saved yet?
I've ran into something similar, although it was using the entry ID. If you set the category and save the entry, and then upload an asset to that field on the entry does it save into the location you have set? 

Also if the assets field is within a matrix you'll need to use owner 

{owner.galleryCategory.first.slug}