fix Image onload was declared after the src is set