Reading images on the fly during training in torch