I want to know if it's possible to retrieve images programmatically from iMessage
app, which are not saved in camera app. I know it is not possible for a third party app to access the resources of native app. I just want to make sure that it is valid for iMessage app too.
Apple doesn't allow this. You cannot access messages or the media received with that message unless the images are saved to gallery.
Even if you do this somehow, Apple wouldn't allow it to be in the App Store.