I had a look at modding this game and doing something more dynamic, the issue is you cannot read the filesystem at all in JS (despite what some bs online tutorials claimed. I tried them all, they don't work). So the html needs to know the path of all the cards, pictures etc ahead of time. That's why cards have a value for how many gifs they have, and there's code that determines what the filename is and only the browser itself can then load it.
I'm thinking of ways around it, such as loading all the possible image names for card gifs and counting how many actually display by checking the height of the resulting frame, but unless you hardcode the mods into the html or run the game in a web server and try loading via ajax or have mods include their own script that the main code somehow knows the name of and calls there's just no easy way to do it in the current game engine.