Changed im_flat to im_flat_random for faster image load.