I want to check that the homotopy category of cochain complexes of an idempotent splitting, preadditive category is idempotent splitting.

Let $a\xleftarrow{e}{}a$ be an idempotent chain map up to chain homotopy, $e^2\sim e$; that is, there exists maps $a_{i-1}\xleftarrow{h_i}a_i$ with $e_i^2-e_i=h_{i+1}d_i+d_{i-1}h_i$. Assuming that idempotents split in the underlying category, how can I construct a chain complex $im\left(e\right)$ with chain maps $im\left(e\right){\xleftarrow{p}\atop \xrightarrow[i]{}}a$ such that $ip\sim e$ and $pi\sim1_{im\left(e\right)}$?