title: Setting UIImageView image affects layout constraints
body: <p>I am creation a simple UIImageView with the following constraints:</p>
  
  <pre><code>self.view.addConstraint(imageView.topAnchor.constraint(equalTo: contentLayoutGuide.topAnchor))
  self.view.addConstraint(imageView.centerXAnchor.constraint(equalTo: contentLayoutGuide.centerXAnchor))
  self.view.addConstraint(imageView.heightAnchor.constraint(equalTo: contentLayoutGuide.heightAnchor))
  self.view.addConstraint(imageView.widthAnchor.constraint(equalTo: contentLayoutGuide.heightAnchor))
  </code></pre>
  
  <p>The important one is the last one, which sets the width equal to the height of the image view and the height of the image view is being defined by top and bottom anchor.</p>
  
  <p>Now this looks perfectly fine (see image below)
  <a href="https://i.stack.imgur.com/Uk1CZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Uk1CZ.png" alt="example image view"></a></p>
  
  <p>However when setting <code>imageView.image</code> the image is all over the screen and way too big.
  This debugging process fixes it:</p>
  
  <pre><code>po for cn in self.imageView!.constraints { cn.isActive = false }
  po CATransaction.flush()
  </code></pre>
  
  <p>This makes the image fit inside the imageView as it is intended but up until this point, the imageView is messed up.</p>
  
  <p>What is interesting, before setting the image, the imageView itself does not have any constraints and then setting the image creates those two:</p>
  
  <pre><code>- 0 : &lt;NSContentSizeLayoutConstraint:0x6040002b2120 UIImageView:0x7fa98f757b90.width == 488 Hug:250 CompressionResistance:750   (active)&gt;
  - 1 : &lt;NSContentSizeLayoutConstraint:0x6040002b2180 UIImageView:0x7fa98f757b90.height == 487 Hug:250 CompressionResistance:750   (active)&gt;
  </code></pre>
  
  <p>Those constraints seem to break it, because disabling them fixes the problem. They are only added when setting an image</p>