Added image rescaling in detect.py