Add onerror event for image