$("document").ready(function() {
    $(".body-column img").each(function() {
        if($(this).attr("alt") != null && $(this).attr("alt") != "" && $(this).attr("width") != null && 
            $(this).attr("width") != "" && ($(this).attr("class") == "image-left-caption" || 
            $(this).attr("class") == "image-center-caption" || $(this).attr("class") == "image-right-caption")) {
                var floatDir = $(this).css("float");
                var width = $(this).attr("width");
                
                //we need to do things a little differently if it's the center one since there's no float center.
                if($(this).attr("class") == "image-center-caption") {
                    $(this).wrap("<div class=\"imgWrapper\" style=\"width:" + width + "px;margin:0 auto;\">");
                } else {
                    $(this).wrap("<div class=\"imgWrapper\" style=\"width:" + width + "px;float:" + floatDir + ";\">");
                }
                
                $(this).after("<div class=\"caption\">" + $(this).attr("alt") + "</div>");
        }
    });
});