trim, center and pad image before predicting