<div id="DisplayGalleryImage">
<div id="galleryImage-container">
<div class="img-up-add img-item addGallery">
<span class="img-add-icon">+</span>
</div>
<input type="file" name="files" id="galleryImage" multiple="" />
</div>
</div>
$(".addGallery").click(function() {
$("#galleryImage").click();
});
$("#galleryImage").change(function() {
for (var i = 0; i < this.files.length; i++) {
imgpath = getObjectURL(this.files[i]);
$("#galleryImage-container").prepend("<div class='img-thumb img-item galleryImage' data-index='" + index + "'><img class='thumb-icon' src='" + imgpath + "' data-index='" + index + "'><div class='img-remove removeGalleryImg' data-xindex='" + (index++) + "' >x</div></div>");
}
});
$("body").on("click", ".removeGalleryImg",
function() {
var num = $(this).attr("data-xindex");
$("div[data-index=" + num + "]").remove();
});