Fixed image loading javascript.