perché fai

imgWidth = img[0].getWidth(this);
imgHeight = img[0].getHeight(this);

?

Prova a sostituire quei this con 2 null.