img onload/error handler were not fired correctly.