Remove unnecessary functions
Add function to downsample an image