Сделал. Все заработало, только есть какой-то лаг. Список сразу не отображается. Только после нажания на него. Подскажите - моя ошибка в том что я вызываю функцию jQuery не правильно? 
function myFunction() {
 
var name_element = document.getElementById('image_picker_count');
var count_id = name_element.value;
 
if (count_id == '0') {
$('#image-picker').attr('multiple', false);
jQuery("select.image-picker").imagepicker({
hide_select:  true,
});
}
else
{
$('#image-picker').attr('multiple', true);
jQuery("select.image-picker").imagepicker({
hide_select:  true,
limit_reached:  function(){alert('We are full!')},
limit: count_id,
});
};
  
}