Image publishing issue in Snipet templates

I am try to set up publishing for images in CT A.
There is a snippet template associated with CT A. I am calling this snippet in a Slot of CT B. I have created a new location Scheme in Delivery Context(which is our default for file publishing context variable) for CT A Image. When I test using JEXL expression, it looks fine, but when I run the edition the image is getting published as xml file which is weird.

I figured out that the Default Schema is associated to some default xml template which is causing this issue. I am little hesitant to change that settings.

Any other way around to get this working?

I am working on 6.7 Version.

Paddy

Here is the Location Scheme’s JEXL Expression for Image Template in the CT A

$t = $user.asmTools.lookupPublishPath($tools.math.toInteger($sys.params.sys_contentid));
$i = $t.indexOf(’/’,1);
$site = $t.substring(1,$t.indexOf(’/’,1));
$t = $t.substring($i);
$fn = $rx.location.getFirstDefined($sys.item,‘rx:filename’, $sys.item.getProperty(‘rx:sys_contentid’).String) + $sys.template.prefix + $rx.location.getFirstDefined($sys.item,‘rx:image1_ext’, $sys.getClass().forName(‘org.apache.commons.lang.StringUtils’).defaultIfEmpty($sys.template.suffix, ‘.jpg’));
if( $t.startsWith(’/web/’)) {
$t = ‘/’ + $site + $t + $fn;
} else {
$t = ‘/image_server/’ + $site + $t.replaceAll(’^/(?:fast|resources)/’,’/’) + $fn;
}
$t.replaceAll (’ +’,’-’).replaceAll(’[^/.A-Za-z0-9_-]’,’’).replaceAll(’–+’,’-’).toLowerCase();

Is it possible that it’s being published more than once by different content lists? Location Schemes are still somewhat of a black art for me, but my experience has been that if one explicitly creates a location scheme for a content type and that item is brought in by some content list, that specific location scheme will be used. However, I’ve seen it happen where another content list will also bring it in and overwrite. Have you run a full publish and checked the publishing logs to make sure what you expect to happen is happening?

Thanks DTaylor. It’s working now. I assigned a wrong CT to the Location schema.
Paddy