         switch renderCurrentDecoderOutput() {
         case .rendered(let renderedImage):
             // Show the next image.
-            _imageView.image = renderedImage
+            layer.contentsScale = image.scale
+            layer.contents = renderedImage
             
             // for a 60 FPS system, we only have a chance of replacing the content per 16.6ms.
             // To provide a more accurate animation we need the determine the frame starting

            
        case .fallbackToDefault(let defaultImage, let error):
            onDecodingFrameError(.init(error: error, canFallbackToDefaultImage: true))
            _imageView.image = defaultImage
            stopAnimating()
            onFallBackToDefaultImage()
        case .defaultDecodingError(let error, let defaultImageError):
            onDecodingFrameError(.init(error: error, canFallbackToDefaultImage: false))
            _imageView.image = nil
            stopAnimating()
            onFallBackToDefaultImageFailed(defaultImageError)
        }

    /// This method is provided as a fallback for setting a normal `UIImage`. This does not start the animation or
    public convenience init(image: UIImage?) {
        self.init(frame: .zero)
        layer.contentsScale = image?.scale ?? screenScale
        layer.contents = image?.cgImage
    }
    
    /// Creates an APNG image view with the specified frame.
    /// - Parameter frame: The initial frame that this image view should be placed.
    public override init(frame: CGRect) {
        super.init(frame: frame)
    }
    
    // Stop the animation and free the display link when the image view is not yet on the view hierarchy anymore.
