fix bug where image file data not getting submitted properly through ajax, referenced: http://digipiph.com/blog/submitting-multipartform-data-using-jquery-and-ajax