Figures with Selected Graylevel

(* Image consists of clusters from WKMeans in GrayLevel of its centers *)
SelectedGrayLevel[sol_]:=Module[{AAA,sl0,pp0},
		(* The whole image put in GrayLevel [[1]] *)
Do[
AAA=Table[Table[{1,sol[[1,j,s,3]]},{s,Length[sol[[1,j]]]}],{j,Length[sol[[1]]]}];
		(* jj-th cluster put in color sol[[2,jj]] *)
AAA[[jj]]=Table[{sol[[2,jj]],sol[[1,jj,s,3]]},
{s,Length[sol[[1,jj]]]}];
		(* Image construction *)
podDop0=Flatten[AAA,1];
sl0=SortBy[podDop0,Last];
pp0=sl0[[All,1]];
slikaN0[jj]=Table[Table[pp0[[i+k bb]],{i,bb}],{k,0,aa-1}];
Print[Image[slikaN0[jj],ImageSize->Small]]; 
		(* Color of center sol[[jj]] *)
(* Print[Graphics[{GrayLevel[sol[[2,jj]]],Disk[]},ImageSize->20]];*)
,{jj,2,Length[sol[[2]]]}]; 
						(* All clusters together *)
		(* The whole image put in GrayLevel [[1]] *)
AAA=Table[Table[{1,sol[[1,j,s,3]]},{s,Length[sol[[1,j]]]}],{j,Length[sol[[1]]]}];
		(* For all jj, jj-th cluster put in color sol[[2,jj]] *)
 Do[
AAA[[jj]]=Table[{sol[[2,jj]],sol[[1,jj,s,3]]},
{s,Length[sol[[1,jj]]]}]
,{jj,2,Length[sol[[2]]]}];
			(* Image construction *)
podDop0=Flatten[AAA,1];
sl0=SortBy[podDop0,Last];
pp0=sl0[[All,1]];
slikaNAll=Table[Table[pp0[[i+k bb]],{i,bb}],{k,0,aa-1}];
Print["Each cluster in GrayLevel of its center:"];
Print[Image[slikaNAll,ImageSize->Small]]
]