Hello Federico. Great job on the solution. It looks amazing.
To answer your question, both methods are fine however in my experience the image tends to load more slowly when you do the render in Javascript instead of hiding the HTML and then displaying it via Javascript. Generally too much Javascript tends to slow down websites.
Hope this was helpful.
Marked as helpful
@02fede02
Posted
@zaks276 Thank you very much!