somehow imageError method doesn't call. added method inner function