If you make a small image bigger, you will always lose quality. If you're trying to re-size a 128 head up to 512, I recommend just making it again but bigger. Or you could scale it up and then draw in extra details and smooth the pixels or whatever.