Force resizing of input image to be not larger than 512x512 frame size