ahhh! OK, here is one way. Perform your collision check before you actually move your player. In other words, try and predict the next x & y coordinates of your player before you actually move him. If your player + the next gravity value would position your player below the ground then let the y of your player = the ground y (- height of your image).
Hope that helps.
Hope that helps.