         }
     }
 
-    override func onScreenHeight(for containerWidth: CGFloat) -> CGFloat {
-        guard let image = image else {
-            return 0
-        }
-
-        let targetWidth = onScreenWidth(for: containerWidth)
-        let scale = targetWidth / image.size.width
-
-        return floor(image.size.height * scale) + (appearance.imageMargin * 2)
-    }
-
-    override func onScreenWidth(for containerWidth: CGFloat) -> CGFloat {
+
+    /// Returns the Image Width, for the specified container width.
+    ///
+    override func mediaWidth(for containerWidth: CGFloat) -> CGFloat {
         guard let image = image else {
             return 0
         }

    }


    // MARK: - Drawing

    /// Draws ImageAttachment specific fields, within the specified bounds.
    ///
    override func drawCustomElements(in bounds: CGRect) {
        guard let caption = caption else {
            return
        }

        let textRect = caption.boundingRect(with: bounds.size, options: [.usesLineFragmentOrigin, .usesFontLeading], context: nil)
        let messageY = bounds.maxY + appearance.captionMargin

        // Check to see if the message will fit within the image. If not, skip it.
        let messageRect = CGRect(x: bounds.minX, y: messageY, width: bounds.width, height: textRect.height)
        caption.draw(in: messageRect)
    }
}

    }


    // MARK: - OnScreen Metrics

    /// Returns the Attachment's Onscreen Height: should include any margins!
    ///
    override func onScreenHeight(for containerWidth: CGFloat) -> CGFloat {
        guard let captionSize = captionSize(for: containerWidth) else {
            return super.onScreenHeight(for: containerWidth)
        }

        return mediaHeight(for: containerWidth) + appearance.imageMargin * 2 + appearance.captionMargin * 2 + captionSize.height
    }


    // MARK: - Image Sizing + Positioning

    /// Returns the x position for the image, for the specified container width.
    ///
    override func mediaPositionX(for containerWidth: CGFloat) -> CGFloat {
        let imageWidth = onScreenWidth(for: containerWidth)

        switch alignment {
