Don't let attachment image thumbnails overflow their containers.

Previously, image file attachments of certain dimensions would make
it possible for the thumbnail to overflow the thumbnail container,
which looked really ugly. We stop doing that now.

Reviewed at https://reviews.reviewboard.org/r/5444/.
hostingsvcs.bitbucket : Add optional api version argument to _build_api_url

We want to be able to use Bitbucket API versions 1 and 2.

Testing Done:
hostingsvcs tests.Bitbucket pass

Reviewed at https://reviews.reviewboard.org/r/5445/