Well you're doing a few things wrong.
First if you hardcode your speed you obviously don't need that 1/-1 for direction...
Second take again a closer look at my example, I've put the movement function outside of the while(window.pollEvent()) loop. That's what you have to do too. If your code does not depend on an event then it should never be in the event loop.
Third you're loading a new image whenever you press a key, this leads to the freezing, when keeping the key pressed, since SFML then is working very hard loading constantly a new image => very inefficient.
At best you should put all the diffrent images of your character in one image and then load this onces. You then can use sprite.setTextureRect to change the visible rectangle on the texture (i.e. you can 'cut' out the image you need). That way you'd load the texture once and then only move the rectangle on the loaded image.
I would suggest to use setFramerateLimit since one can force VSync to be off or on from the system and SFML's setVerticalSync won't be able to change anything.