I have a similar issue with mine, a 3.2" Itead studios Glcd using the UTFT Lib (Thank You Henning) and I have a similar issue to yours I have a 20 cm 40 pin female to male adapter cable and occasionally when I move the cable I get a similar effect. Looking at that rats nest of wiring to the display I wonder about 2 things, first that display is not 5 V tolerant so unless you have the Mega's outputs fed to level shifters of some kind you might well have issues there. I don't think that is your issue though. Second I think more that you have an open/shorted connection somewhere between the Mega and the Glcd. I would recommend you Carefully without disturbing any of the wires do a continuity check for open connections. I say carefully because you might well fix it for a time by moving wiring. The next test I would think is a check for adjacent shorts. Pins that are bridged either with solder or a loose wire strand. It's hard to tell by looking at 40 red wires between a Mega and a display in a 30 cm wooden box though. Looking at that thing I can easily understand why it's in a box... It does look rather fragile and that is likely a big part of your problems. My display has a cable from the display to the Mega shield made for that display by Elec Freaks, The Sain Smart part is the same.. at least from the pictures but vastly overpriced.. and I would Highly recommend an interface shield made for the Mega and that Glcd.
Bob