Display suite PHP field using tokens I'm trying to use a Display Suite field to wrap an image in a div.

What I also want to do is to htmlspecialchars on the token [node:field_mainimage].

It doesn't want to work for me. Is there any other way I can accomplish this?
Where are those images placed ? 

If this is in content type, you can style the content type content by using custom tpl.php files and wrap your images in div there. (in sites/all/thems/yourtheme , that is.)

Also, you can create template files even for fields.

That gives you enormous power of controlling output :) .

It is bit "dirty", but you can also wrap images in div using jQuery. But first method is cleaner.