Image Offset for NLE image import v2.79

I’m trying to create a slide show in the non-linear editor. The pictures are a mix of portrait and landscape. In the UI I need to check the box “Image Offset” to prevent the portrait pictures from being stretched. How can I script this on import?