public static FindNearbyContact lookupUserRecord(
      ContentResolver contentResolver, Configuration configuration, String bitcoinAddress) {
    FindNearbyContact record = null;
    String name = configuration.getFindNearbyUserName();
    Uri photoUri = configuration.getFindNearbyUserPhoto();

    byte[] photo = null;
    if (photoUri != null) {
      try {
        Bitmap bitmap = MediaStore.Images.Media.getBitmap(contentResolver, photoUri);
        Bitmap scaledBitmap = AddressBookProvider.ensureReasonableSize(bitmap);
        if (scaledBitmap == null) throw new IOException();

        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        scaledBitmap.compress(CompressFormat.PNG, 100, outStream);
        photo = outStream.toByteArray();
      } catch (FileNotFoundException ignored) {
      } catch (IOException ignored) {
      }
    }

    record = new FindNearbyContact(bitcoinAddress, name, photo);
    return record;
  }