---
schema_version: "1"
id: 846ea3175ed6d9988b343efce13275e56bdafb3805a9b29493c0fa22c0ac098f
title: ContentImagebyKey
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_platformContentContentImageByKey.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_platformContentContentImageByKey.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: cc3c773c38b83f465375ead4bba2fad89c7c4c86f0a8c83482f1efc16fb97ff5
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# ContentImagebyKey

## Overview

Returns an img tag with the src attribute containing the path to an image from Content Builder. Identify the image to include with the ID value. The img tag includes the title and alt information for the selected image, as well as a border value, measured in pixels, and any identified thid value. If the value of the first parameter does not link to a valid image, you can include another image value for the second parameter as a default option.

### Syntax

ContentImagebyKey(1, 2)

### Function Properties

<!--complex table-->

| Ordinal | Type   |              | Description                                                             |
| ------- | ------ | ------------ | ----------------------------------------------------------------------- |
| **1**   | string | **Required** | External key of image to return                                         |
| **2**   | string | **Required** | Value used to return image if function can’t find the original image ID |

## Example

```
<script runat="server">
     var content = Platform.Function.ContentImagebyKey("myImageKey","defaultContentHere");
</script>
```
