Here is a button:
and a bound event:
$(\"#addToCart\         
        
The header has the clues you need.
Your request to '/cartManager/add' is being forwarded to '/cartManager/add/' (notice the ending forward slash).
Replace your ajax call with
$.ajax({
                    url: '/cartManager/add/',
                    data:{
                        pictureId: currentImageId,
                        printSize: $("#size option:selected").val(),
                        paperType: $("#paperType option:selected").val(),
                        quantity: 1
                    },
                    success: function(){
                        $("#modal").html("ОК
Closing in a sec
").delay(1000);
                        $("#modal").overlay().close();
                    }
                });