But you'll need this magic number, or you'll end up typing the new size by hand. Yes, I'm lazy. You are too, and you know it.
So if you're exporting your UV map as an EPS, export it at 7.12 inches. That's 512 pixels.
There, I just saved you some seconds.