def tile_images(img_nhwc):
img_nhwc = np.asarray(img_nhwc)<EOL>N, h, w, c = img_nhwc.shape<EOL>H = int(np.ceil(np.sqrt(N)))<EOL>W = int(np.ceil(float(N)/H))<EOL>img_nhwc = np.array(list(img_nhwc) + [img_nhwc[<NUM_LIT:0>]*<NUM_LIT:0> for _ in range(N, H*W)])<EOL>img_HWhwc = img_nhwc.reshape(H, W, h, w, c)<EOL>img_HhWwc = img_HWhwc.transpose(<NUM_LIT:0>, <NUM_LIT:2>, <NUM_LIT:1>, <NUM_LIT:3>, <NUM_LIT:4>)<EOL>img_Hh_Ww_c = img_HhWwc.reshape(H*h, W*w, c)<EOL>return img_Hh_Ww_c<EOL>
Tile N images into one big PxQ image
(P,Q) are chosen to be as close as possible, and if N
is square, then P=Q.

input: img_nhwc, list or array of images, ndim=4 once turned into array
    n = batch index, h = height, w = width, c = channel
returns:
    bigim_HWc, ndarray with ndim=3