Loading image problem, please help

The below code works, no errors but doesn’t work like I want it too.

For example: Look at the following code:
[AS]trace(img_mc._width); //produces a value
img_mc.ResizeImage(22,22);[/AS]
This is what I don’t get: img_mc Mc doesn’t call my prototype
for some reason. I know the prototype works because if I call
the prototype with another Mc like ThumbnailMc it works.

Apparently img_mc losses itself as a Mc but generates a _width
value prior to calling the prototype. Don’t know why, help.
[AS]MovieClip.prototype.ResizeImage = function(wMax, hMax) {
if (this._width>wMax || this._height>hMax) {
trace(“ss”);
//which dimension is the most oversized
wDiff = this._width-wMax;
hDiff = this._height-hMax;
//calculate ratio
if (wDiff>hDiff) {
ratio = (wMax/this._width)100;
} else {
ratio = (hMax/this._height)100;
}
} else {
//if image doesn’t need to be resized set ratio to 100
ratio = 100;
}
this._xscale = this._yscale=ratio;
};
var McHolder = _root.createEmptyMovieClip(“Container”, 550);
Mc = McHolder.attachMovie(“ColorMc1”, “ColorMc1”, 45);
Mc._x = 74
i;
Mc._y = 39
j;
ThumbNailMc = _root.Container.ColorMc1;
img_mc = ThumbNailMc.createEmptyMovieClip(“PicContainer”, 25);
img_mc.loadMovie(“http://mysite/photos/image.jpg”);
Mc.onEnterFrame = function() {
var bytes_loaded = Math.round(img_mc.getBytesLoaded());
var bytes_total = Math.round(img_mc.getBytesTotal());
var getPercent = bytes_loaded/bytes_total;
if (bytes_loaded>1 && bytes_loaded>bytes_total-10 && img_mc._width>0 && getPercent>=1) {
trace(img_mc._width);
img_mc.ResizeImage(22, 22);
delete this.onEnterFrame;
}
};
stop();[/AS]