data.py: fix cropping memory bug