I’d guess it’s because you’re not waiting for the image to load – try this:
var newimage = new Image();
newimage.src="https://stackoverflow.com/questions/1645166/retouche-hr" + newlinkimage.substring(14,17) + '-a.jpg';
newimage.onload = function()
{
var width = this.naturalWidth;
alert(width);
}