列に画像を保存しています。テーブルの画像フィールドが空のときに img タグを非表示にしたいだけです。
$imgResult= explode('**',$resultArray['mediaGallery']);
if(empty($imgResult)===true){
echo "<script type=\"text/javascript\">
$(document).ready(function(e) {
$('.display').css('display','none');
});
</script>";
}