Fix missing template dependency
Prepare the template for dynamic record item to handle real use case.
Use image component to handle images.

Extracts the image handling logic to a new component for better separation of
responsibilities. The new code performs as well as the old one.