Well it needs to be a balance, but on the whole, you can get great images with any body, and any lens...
Moving up the food (or price) chain in either lens or body is about two factors;
1. Improving your chances to get the shot.
2. Improving the little details of image quality.
Both Bodies and lenses contribute.
The common argument is that you will see more improvement in image quality when you move to a great lens, than you will when jumping from one current model DSLR to anotehr..
Thin in terms of the Film ERA, and IQ did not enter into choice of Body,.
The differences in Body was only a matter of "features" ,. putting the body upgrade ONLY in category 1. ( "Improving your chances of getting the shot" )
This legacy is altered, but to most still holds true for the most part.
The lens upgrade alters both, as with the hopefully improvement in image quality (however slight) you will also get improvements in Category 1. via faster Autofocus, larger aperture, IS, and other advantages.
So deciding which is more important to upgrade is based on what is holding you back now.
Is it "getting the shot" or is it poor image quality when you do get the shot? or a combination.. and what specific things will help you get the shot.