@Override
    public Drawable getDrawable(final String source) {
        try {
            Drawable repositoryImage = requestRepositoryImage(source);
            if (repositoryImage != null) {
                return repositoryImage;
            }
        } catch (Exception e) {
            // Ignore and attempt request over regular HTTP request
        }

        try {
            String logMessage = "Loading image: " + source;
            Log.d(getClass().getSimpleName(), logMessage);
            Bugsnag.leaveBreadcrumb(logMessage);

            Request request = new Request.Builder()
                    .get()
                    .url(source)
                    .build();

            Response response = okHttpClient.newCall(request).execute();

            if (!response.isSuccessful()) {
                throw new IOException("Unexpected response code: " + response.code());
            }

            Bitmap bitmap = BitmapFactory.decodeStream(response.body().byteStream());

            if (bitmap == null) {
                return loading.getDrawable(source);
            }

            BitmapDrawable drawable = new BitmapDrawable( context.getResources(), bitmap);
            drawable.setBounds(0, 0, bitmap.getWidth(), bitmap.getHeight());
            return drawable;
        } catch (IOException e) {
            Log.e(getClass().getSimpleName(), "Error loading image", e);
            Bugsnag.notify(e);
            return loading.getDrawable(source);
        }
    }
Request an image using the contents API if the source URI is a path to a
file already in the repository

@param source
@return
@throws IOException
app/src/main/java/com/github/pockethub/android/util/HttpImageGetter.java