Object Export Options…
After setting an image in InDesign, select the image with the selection tool. At the top of the screen, click Object, and then select Object Export Options… and you’ll get the following dialogue box:
In this dialogue box, you can adjust the export options of that particular image/object when exporting to epub. You can adjust the output resolution, quality, and format. Here, you can also set your images to adjust their size “Relative to Page Width” which means that the image size will adjust to the width of any device and the different orientations of that device. Additionally, you can set the output alignment and spacing.
If you have numerous images that will all have the same export options, the same settings from the Object Export Options… dialogue box are available in the epub export settings. Those settings, however, will apply to all of the images though you can choose to not override local object export settings.
When exporting to epub, InDesign “reads” your document left-to-right, top-to-bottom and arranges the text and objects in the order in which it encounters them. This can cause some objects to appear in unexpected locations. If your text is all in one thread, when exporting to epub, InDesign will put all of your text first, then all of your images and other objects will fall to the end of the text.
To prevent this, you must to anchor your images and any other objects (tables, textboxes, sidebars, etc.). All you have to do is: select your image/object, click the blue square in the top right corner of the object, and drag it until the cursor is in the location you’d like the object to appear in the epub as shown below.
After anchored, the object will have an actual anchor where the blue box used to be.