Do you already know pLoader?
What is pLoader for you?
Can I set up ploader to upload to the folder "gallery/*category*" instead of the folder "upload"?
No, you can't. Why is the directory "upload" instead of "gallery" a problem? Is it because you can't control the name of the directories? (in the "upload" directory, the sub-directories do not correspond to categories at Piwigo logical level).
You tried to ask if a solution is possible.
You get a negative answer.
But you have a problem.
Explain your problem, maybe we might have a real solution to it.