Yes it is possible. It depends which platform you are developing for, as to the best way to do something like this.
If you are making the project for PC, then you can use NWjs and simply pick files from a folder at random to display - whether they're text or pictures.
If you are making this for mobile then you can use other methods, like loading the images from a URL perhaps - of it your images are embedded in the project you can just make them all in one sprite object as animation frames, then set the animation frames randomly.
IT also depends what you mean by "database". The way data structure is typically/easily done in Construct 2 is via JSON, but you can do any way you like depending on your ability. I have made database structure will token delimited plain text, as well as JSON, as well as nested dictionary JSON. It really just depends how you want to make it work
~Sol