So it's probably the one layer thing. When you get done with the heightmap, flatten it and then copy it and paste it into another document, making sure it's 513 x 513, grayscale and no alpha channel. Then export it as however you want it, but as a .png. Flattening or merging the layers does not work, it has to be one layer all throughout the process.