If you know the iMessage account of your contact here is a bash script of mine to retrieve text + images.