Random crop bugfix and abstracting random number generation inside data_transformer