/// <summary>
        /// Builds a image header.
        /// </summary>
        /// <param name="profile">A <see cref="DeviceProfile"/>.</param>
        /// <param name="container">The container.</param>
        /// <param name="width">Optional width.</param>
        /// <param name="height">Optional height.</param>
        /// <param name="isDirectStream">True if the image is via direct stream.</param>
        /// <param name="orgPn">Optional organisation.</param>
        /// <returns>A string representation.</returns>
        public static string BuildImageHeader(
            DeviceProfile profile,
            string container,
            int?width,
            int?height,
            bool isDirectStream,
            string?orgPn = null)
        {
            if (profile == null)
            {
                throw new ArgumentNullException(nameof(profile));
            }

            string orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetImageOrgOpValue();

            // 0 = native, 1 = transcoded
            var orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";

            const DlnaFlags FlagValue = DlnaFlags.BackgroundTransferMode |
                                        DlnaFlags.InteractiveTransferMode |
                                        DlnaFlags.DlnaV15;

            string dlnaflags = string.Format(
                CultureInfo.InvariantCulture,
                ";DLNA.ORG_FLAGS={0}",
                DlnaMaps.FlagsToString(FlagValue));

            if (string.IsNullOrEmpty(orgPn))
            {
                var mediaProfile = profile.GetImageMediaProfile(
                    container,
                    width,
                    height);

                orgPn = mediaProfile?.OrgPn;

                if (string.IsNullOrEmpty(orgPn))
                {
                    orgPn = GetImageOrgPnValue(container, width, height);
                }
            }

            if (string.IsNullOrEmpty(orgPn))
            {
                return(orgOp.TrimStart(';') + orgCi + dlnaflags);
            }

            return("DLNA.ORG_PN=" + orgPn + orgOp + orgCi + dlnaflags);
        }