class MraidNativeCommandHandler {

    void storePicture(@NonNull final Context context,
            @NonNull final String imageUrl,
            @NonNull MraidCommandFailureListener failureListener) throws MraidCommandException {
        if (!isStorePictureSupported(context)) {
            MoPubLog.d("Error downloading file - the device does not have an SD card mounted, or " +
                    "the Android permission is not granted.");
            throw new MraidCommandException("Error downloading file " +
                    " - the device does not have an SD card mounted, " +
                    "or the Android permission is not granted.");
        }

        if (context instanceof Activity) {
            showUserDialog(context, imageUrl, failureListener);
        } else {
            Toast.makeText(context, "Downloading image to Picture gallery...", Toast.LENGTH_SHORT).show();
            downloadImage(context, imageUrl, failureListener);
        }
    }

}