A 16x2 LCD connected to my Mega according to your code and running your code works fine. So it is not the code, it is by elimination your hardware. Like @J-M-L says, disconnect everything but the LCD and try the code. If it does not work, check the contrast adjustment, carefully inspect the wiring and test or replace the jumpers. Post a clearer photo of the wiring. You would be surprised how many times that we have spotted wiring problems that the poster did not see. More eyes are better.