Bug solved, img initialized.