That was definitelly the problem, tried using Crypt::Rijndael::MODE_CTR() directly and i was able to see the jpeg header.
Now the problem is dealing with padding because Rijndael now complains with the "encrypt: datasize not multiple of blocksize (16 bytes)" error.
I tried Crypt::Ctr to handle all that stuff but it doesn't seem to accept a IV as an argument.