Custom Sanitation Function Triggering an Alert in Customizer?

Ok i solved it looks like that getimagesize will generate error/notice if image is not found, so alert box will fire…

This is straight from PHP docs:

If accessing the filename image is impossible getimagesize() will generate an error of level E_WARNING. On read error, getimagesize() will generate an error of level E_NOTICE.

Here is the solution that worked for me:

function is_image( $input ) {
   if ( !empty($input) && getimagesize($input)) {
     return esc_url_raw($input);
   } else {
    return '';
   }
}

If somebody has a better solution please let me know…