Fixed image onload bug