Split out test code for generating inline image elements