Resize images to prevent Out of Memory Exception