code: def calculate_dimensions(image, long_side, short_side):
      
      if image.width >= image.height:
          return '{0}x{1}'.format(long_side, short_side)
      return '{0}x{1}'.format(short_side, long_side)
docs: Returns the thumbnail dimensions depending on the images format.