Images are now resized before encoding