Fix EZP-22124: inline image alignment is not respected
(cherry picked from commit 8667993b8a940d50275728ed546a2ed8296376cf)