Fixed: resize method invoked JS error before img was ready