I'm not sure if the question is marked incorrectly, but I do not see your select2 function in the code that you specified
however, here is a sample of select2 template code that will use the images in the selection and the result
function formatData (data) { if (!data.id) { return data.text; } var $result= $( '<span><img src="/Ressources/Images/Locked.png"/> ' + data.text + '</span>' ); return $result; }; $("#SelectPeriode").select2({ templateResult: formatData, templateSelection: formatData });
source share