Problem with independent outputs and rerolling images and descriptions

Open link in next tab

League of Legends Strat Roulette ― Perchance Generator

https://perchance.org/srstratroulette

League of Legends Strat Roulette ― Perchance Generator

I made a post on Reddit not knowing the community had moved to Lemmy, which can be found here.

I wrote a more detailed explanation with code snippets there, but to summarize I am trying to implement independent card randomizers where each card has its own description and image. Before implementing images, I was able to reroll what was just the card's description. However, the approach I took to make this compatible with specific images yielded an error when trying to reroll any of the cards. Loading the generator does not come with any errors. What can I do to resolve these errors?