Any image is just a long string of bits, which is easy to interpret as a number in base 2. It would then be a straightforward step to designate that n by the nth prime. So in theory there is nothing complicated about encoding any binary file as a prime. (There are undoubtedly more efficient ways to do it.)