16X2 character LCD changes contract intermittently and doesn't work with raspberry pi
Looks like a bad LCD. You can try resoldering your connections to the LCD, they look poorly done. The joints should look like this: 
http://smartduino.com/wp-content/uploads/2012/11/SMRTM501.jpg 

See this guide for troubleshooting bad solder joints: 
http://learn.adafruit.com/adafruit-guide-excellent-soldering/common-problems