The 2 key things to watch out for are to keep your knees together and to tuck your hips under. You may not get your foot as high at the back as it is in this picture, but you will be doing the stretch properly.
The best way to find out if you are a “quad stretch cheater” is to try it lying down, like the second picture. Concentrate on keeping both hips on the ground and your knees together. Now you should really feel a great stretch down the front of your thigh.