What you are using is the so-called Text-Book RSA. For encryption, we always want the correctness requirement and for public-key systems, this is;
$$D(prv,(E(pk,m)) = m$$ where $E$ is the public key encryption with the public key ($pk$) and $D$ is the decryption with the private key ($prv$).
In Text-Book RSA if we let the messages $m\geq n$ then as you noticed the decryption is not giving back the original message instead provides the $m'$ such that $m' = m \pmod n$ $(9 \equiv 152 \pmod{143})$. Therefore the meaningful resolution is restricting the message space into $[0..n-1]$. Then we can have the correctness requirement.
If you want to encrypt messages with Text-Book RSA then you can split your files into a chunk of sizes in bits at most $\lfloor \log_2 n \rfloor$-bit*. Here one should consider putting information like the $i$-part of $\ell$, etc. This, however, is not the way to encrypt messages and you must never use the text-book RSA.
We prefer a hybrid-cryptosystem in which the public-key is used to key exchange like RSA-KEM or DHKE and a symmetric cryptosystem is used to encrypt the message with the key.
If you still want to use RSA for encryption then use the correct padding to be secure since the text-book RSA is not secure. RSA should be used with PKCS#1 v1.5 padding or with OAEP.
* To find the number of digits in binary representation of given base 10 integer $n$, calculate $\lfloor \log_2 n \rfloor +1$. Using bits, or actually bytes is much fastert than calculating the data as integer and comparing to the integer $n$.