Patch for attribute error and adding port support to image url

Hi Patrick,

I introduced a bug with that last pull request which should be resolved in this one. I tested it a little more carefully this time.

The other change is to add port support for the image urls. I added this to make local development easier (eg, http://local.dev:8000/filter/width/175/http://local.dev:8000/media/covers/d7e239ce-7cab-4365-b3dc-290d7ef7285f.jpg).