Custom:swipe-card Syntax

I am seeking help with syntax in the dashboard card.
My aim is to generate as many cards as there are entries in the attribute. However, I am stuck with syntax.

# Create swipable cards from the RSS feed
 - type: custom:swipe-card
        cards:
         {%- set j = state_attr('sensor.rss_feed','entries') -%}
         {%- for image in j -%}
         {%- if state_attr('sensor.engineering_feed','entries')[j]['image'] is defined %}
           {%- set image_url = state_attr('sensor.rss_feed','entries')[j]['image'] %}
            {%- if image_url %}
                - type: markdown 
                  content: >
                  <img src="{{ image_url }}" />
              {%- endif %}
            {%- endif %}
          {%- endfor %}
```