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