You can use following code from this answer. Please note this is not JSTL based solution as stated in question.
function imageExists(image_url){
var http = new XMLHttpRequest();
http.open('HEAD', image_url, false);
http.send();
return http.status != 404;
}