TerrainGridTileLoader height maps in wrong order?

Hello and Good afternoon. I have a quick question about TerrainGridTileLoader. In what order should a recently generated height map be sliced up and fed to the TerrainGridTileLoader?

Right now here is the way the height map is being sliced up.
(0,0), (0,1), (0,2), (0,3),
(1,0), (1,1), (1,2), (1,3),
(2,0), (2,1), (2,2), (2,3),
(3,0), (3,1), (3,2), (3,3),

The TerrainGridTileLoader is being intitialized like this

    ImageUtils.sliceImage(bufferedImage,false,false, 4, 4, heightMapPath, "terrain");

    TerrainGridTileLoader terrain = new TerrainGridTileLoader("terrain", patchSize, ( mapResolution  / 2  )+1, new 
    ImageTileLoader(assetManager, new Namer() {
            public String getName(int x, int y) {
                return "terrain_"+x+"_"+y+".png"; 

The tiles load fine, just not in any recognizable pattern. What am I doing wrong here?

Alright, figured out the problem. turns out, the problem was the coordinate system of Swing. Is there an equivalent to Pixmap in jme3?