Add onerror event for image

Solving the big mess...