As per this Azure document, customImageId property accepts string value of the custom image identifier of the virtual machine. So I suggest you to give a try by having customImageId something like shown below.
"customImageId": "[resourceId(variables('resourceType'), parameters('existingLabName'), parameters('imageName'))]"
Note: consider above customImageId if you have below resourceType variable in your variables section
"resourceType": "Microsoft.DevTestLab/labs/customimages"
and consider above customImageId if you have below existingLabName and imageName parameters in your parameters section
"existingLabName": {
"type": "string",
"metadata": {
"description": "Name of an existing lab where the custom image will be created."
}
},
"imageName": {
"type": "string",
"metadata": {
"description": "Name of the custom image being created or updated."
}
}