Prepare sqrt (N )/sqrt(N) square image from N tiles

Your problems seems interesting, just trying to solve it.
One question, does your rgb patches come in this format (N, 3, h,w) ?