Reshape the image into an N x 3

And some bug fixes in h4kmeans
Ignoring tmp files