Intanto dovresti aspettare che l'immagine venga caricata prima di poterne rilevare le dimensioni...
codice:
myImg="";
larghezza=0;
altezza=0;

myImg = new Image();
myImg.src = "foto/cani.jpg";
myImg.onload = function() {
	larghezza=myImg.width;
	altezza=myImg.height;
	location.href="explorer.asp?al="+altezza;
}
ciao