THIS TUTORIAL may help.
Getting a JSON string from an array or dictionary is an object expression used in the action portion of your event. You will typically want to save or load values for an object, or paths to things... JSON data is specific to these objects, but your use of it isn't limited. You can store any information from any object you wish (however you want to define it) and export the data from the array or dictionary as JSON. You then use NWjs or localstorage depending on your target platform to save the JSON string as a file.
In your original question you want to have random images appear and some random text... it's up to you how you define how those work. You can have NWjs count the number of files in the directory, and use a random number in that range to show your image. You will need to come up with a naming structure or other means of easily recalling your images (eg. image01, image02, image03; etc)
Your text could be stored in a single dictionary, and even your folder path to images (or however you're thinking of doing it).
I can't really provide you with an example because you still haven't mentioned which release platform you are wanting to use. It would help if I knew if it was for PC or mobile device/website. I know a lot more about using NWjs (PC) than I do about localstorage.
~Sol