instead of window load use imageloaded