function cropImage(index, callback)
	                		{
	                			function next()
	                			{
	                				if (index < toCropImgs.length - 1)
	                				{
		                				cropImage(index + 1, callback);
	                				}
		                			else
	                				{
		                				callback();
	                				}
	                			};
	                			
	                			var shape = toCropImgs[index];
	                			var imgInfo = shape.toBeCroppedImg;
	                			
	                			var cell = (function (m, k) { if (m.entries == null)
	                                m.entries = []; for (var i = 0; i < m.entries.length; i++)
	                                if (m.entries[i].key.equals != null && m.entries[i].key.equals(k) || m.entries[i].key === k) {
	                                    return m.entries[i].value;
	                                } return null; })(me.vertexMap, new com.mxgraph.io.vsdx.ShapePageId(page.Id, shape.Id));
	                            
	                			var img = new Image();
	                			
	                			img.onload = function()
	                			{
	                				var data = imgInfo.iData;
                                    var type = imgInfo.iType;
                                    
	                				try
		                			{
                                        //TODO There is still some minor inaccuracy in width/height
                                        var scaleX = img.width / imgInfo.imgWidth;
                                        var scaleY = img.height / imgInfo.imgHeight;
		                				var offsetX = (-imgInfo.imgOffsetX) * scaleX;
		                				var offsetY = (imgInfo.imgHeight - imgInfo.height + imgInfo.imgOffsetY) * scaleY;
		                			    var c = document.createElement("canvas");
		                			    c.width = imgInfo.width * scaleX;
		                              	c.height = imgInfo.height * scaleY;
                                        var ctx = c.getContext("2d");
                                        ctx.fillStyle = "#FFFFFF";
                                        ctx.fillRect(0, 0, c.width, c.height);
                                        ctx.drawImage(img, offsetX, offsetY, c.width, c.height, 0, 0, c.width, c.height);
		                            	var jpgData = c.toDataURL("image/jpeg");
	                                    data = jpgData.substr(23); //23 is the length of "data:image/jpeg;base64,"
                                        type = 'jpg';
		                			}
	                				catch(e) 
	                				{
	                					console.log(e);
	                				}
	                				
	                				cell.style += ';image=data:image/' + type + ',' + data;
	                			    next();
	                			};
	                			
	                			img.src = 'data:image/' + imgInfo.iType + ';base64,' + imgInfo.iData;

	                			img.onerror = function()
	                			{
	                				cell.style += ';image=data:image/' + imgInfo.iType + ',' + imgInfo.iData;
	                				next();
	                			}
	                		}
This function is for doing any async processing needed after importing a page