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