//Remove border and bottom margin from smaller images
$('img').each(function() {
    if ($(this).width() <= 50) {
        $(this).css('border','none');
        $(this).css('margin-bottom','0');
    }  
});