move layout to wrapping <span> so image lazy load functions are handled in isolation

fixes #985