Refactored ImageMagickProvider to properly manage ownership and disposal of MagickImage instances, especially when flattening multi-layer XCF files. Updated logic to avoid unnecessary loading of all layers for non-XCF formats, improving performance and resource management. Minor formatting changes in CursorProvider and WebPProvider for consistency.