/// <summary>
        /// Creates and fills instance of <see cref="ImageTransformQuery"/> from URL query string values collection.
        /// </summary>
        /// <param name="queryString">The URL query string values collection.</param>
        /// <param name="defaultTransform">The default transform.</param>
        /// <returns>
        /// The query instance.
        /// </returns>
        public static ImageTransformQuery FromQueryString(NameValueCollection queryString, ImageTransform defaultTransform)
        {
            var instance = new ImageTransformQuery
                {
                    Width = (int)SmartConvert.ChangeType<uint>(queryString["width"]),
                    Height = (int)SmartConvert.ChangeType<uint>(queryString["height"]),
                    Transform = SmartConvert.ChangeType(queryString["transform"], defaultTransform)
                };

            return instance;
        }
        private void EnsureAuthorizedQuery(ImageTransformQuery query)
        {
            var authorized = QueryAuthorizer.IsAuthorized(query);

            if (!authorized)
            {
                throw new HttpException((int) HttpStatusCode.Forbidden,
                    string.Format("Forbidden query 'w={0}&h={1}&t={2}&h={3}'",
                        query.Width, query.Height, Enum.GetName(typeof(ImageTransform), query.Transform).ToLower(), query.Hash));
            }
        }