Hoang - Added a funtion to sample data randomly in block of images.
(Before was sample randomly in row)