Python script for resizing an image depeding upon the aspect ratio user provides