It's not posible to add the buttons directly to the gallery, but you can create a separate detail for each image in the gallery, add your add to cart buttons to the detail page, and add a link to the detail page in the image description.
just make sure to use single quotes in the link:
<a href='image1details.php'>Show Details</a>