             case "jpg":
             case "gif":
             {
-                parsedImageFormat = imageFormat;
+                knownFormat = imageFormat;
                 break;
             }
             default:
             {
-                parsedImageFormat = "png8";
-            }
-        }
-
-        return parsedImageFormat;
+                knownFormat = "png8";
+            }
+        }
+
+        return knownFormat;
     }
 
     public function encodeXML():XML

        return configLayer;
    }

    private static function parseImageFormat(imageFormat:String):String
    {
        var parsedImageFormat:String;

        switch (imageFormat)
        {

        // TODO - configLayer.displayLevels = displayLevels;
        var imageFormat:String = layerXML.@imageformat[0];
        var isDynamic:Boolean = (configLayer.type == DYNAMIC);
        configLayer.imageFormat = isDynamic ? toKnownImageFormat(imageFormat) : imageFormat;
        configLayer.token = layerXML.@token;
        configLayer.url = layerXML.@url;
        const useproxy:String = layerXML.@useproxy;
