It sounds like you may need to adjust the high and low limit stops on the rear derailer, and also adjust the cable tension (might be a good idea to replace cables, especially given the fraying on that one cable in the photo). This website has enough theory and practical information to get you started:
http://sheldonbrown.com/derailer-adjustment.html