Change:
- for (int i = 0; i < data.length; i++) {
- MessagesArray.add(new MessageClass (data[i], randomizeX, randomizeY));
- }
- for (int i = 0; i < MessagesArray.size(); i++) {
- images = new PImage[i];
- images[i] = loadImage(i + ".jpg");
- }
(it cannot work, you reinitialize the
images array on each loop!)
to:
- for (int i = 0; i < data.length; i++) {
- PImage image = loadImage(i + ".jpg");
- MessagesArray.add(new MessageClass(data[i], image, randomizeX, randomizeY));
- }
and of course, add a PImage field to your MessageClass and to its constructor.
Thus, you can get the image from the messageInstance1 instead of picking it from a separate array by computing some index in a convoluted way.

Alternatively, you can also store i in the MessageClass to determine its index / id, or just use the i index in the loop in draw(), etc.
Storing the image in the class is probably the best way (unless, perhaps, two instances of the class can use the same image, but even then they can share the image).
I remain sketchy on purpose (and because of lack of time), but if you need more details, just ask.