I'm using a twitter fetcher by [Jason Mayes](https://github.com/jasonmayes/Twitter-Post-Fetcher/blob/master/js/exampleUsage.js) but as of this morning, twitter appear to have changed how they deliver the profile pictures for twitter feeds.

I'm still only a beginner in javascript and I've studied his code but couldn't see where he drew in the profile pictures from, so I've written a function that takes the attribute from the img (Illustrated below) and applies this to the src attribute.

Unfortunately I must be doing something wrong as it doesn't seem to action. I get this as an error in JS Bin:

**TypeError: Cannot read property '0' of null**

Any suggestions on what I might be doing wrong?

My function:

```
    function profileImageFix(profileImage) 
    {
        profileImage = document.getElementsByClassName("user")[0].getAttribute("data-src-1x")[0];

        document.getElementsByClassName("user")[0].setAttribute(src, profileImage);
    }
    profileImageFix();

```

The HTML pulled through via the twitter feed is:

```
    <div class="user">
      <a href="https://twitter.com/" aria-label="twitter (screen name: twitter)" data-scribe="element:user_link" target="_blank">
        <img alt="" data-src-1x="https://pbs.twimg.com/profile_images/661484218843953664/_B24ia6H_normal.png" data-src-2x="https://pbs.twimg.com/profile_images/661484218843953664/_B24ia6H_bigger.png" data-scribe="element:avatar">
        <span>

        <span data-scribe="element:name">twitter</span>
        </span>
        <span data-scribe="element:screen_name">@twitter</span>

      </a>
    </div>

```