Hi Mr. Aram Azari and thank you for posting,
You are right. Promoted properties for InfoPath forms don't support images or attachments. I believe your error "The selected field cannot be prompted ..." should be "The selected field cannot be promoted..." please confirm.
It sounds like you have the images and attachments under a separate repeating section (or separate fields). In other words, they are not part of some rich text field. To promote these images and attachments - without using code as Anuma's link suggests - you can use our free qRules v2.0 tool to upload them to a separate SharePoint document library. The InfoPath form uploads them using qRules which is a tool injected into yoru form. It replaces the images and attachments with a link. When you click on the link, the image or attachment is opened via the browser. That should meet your requirement!
If you are using a rich text control and have images in it, it's more complicated. Rich text controls in InfoPath use XHTML format. There is a "plaintext" option that allows you to promote the text portion of the rich text control but this won't get you your images. To do that, you need to save the XHTML inner text to a database as a string and create a data view in SharePoint that displays the string stored in the database. We have a new feature in DBXL 2.4 (next version) that supports this, so if you need help you can send us e-mail and we can put you on the v2.4 beta plan.
I hope this post was useful..