$( document ).ready( function() {
    function showUploadedImage( source ) {
        $( "#userImage" ).attr( "src", source );
    }
    $( "#image-form" ).submit( function() {
        var image = document.getElementById( "image" ).files[ 0 ];
        var token = $( "input[type=hidden]" ).val();
        var formdata = new FormData();
        var reader = new FileReader();

        $( "#imageSubmit" ).hide();
        $( "#uploading" ).show();

        reader.onloadend = function ( e ) {
            showUploadedImage( e.target.result );
        }
        reader.readAsDataURL( image );

        formdata.append( "image", image );
        formdata.append( "token", token );

        $.ajax( {
            url: "image/create",
            type: "POST",
            data: formdata,
            cache: false,
            dataType: false,
            processData: false,
            contentType: false,
            success: function( res ) {
                $( "#imageSubmit" ).show();
                $( "#uploading" ).hide();
            },
            error: function( res ) {
                $( "#imageSubmit" ).show();
                $( "#uploading" ).hide();
            }
        } );

        return false;
    } );
} );

@@ -236,16 +236,178 @@
 s%5B 0 %5D;%0A
+        if ( !image ) %7B%0A            $( '#image-form' ).prepend( %22%3Cdiv class='alert alert-danger'%3EThis isn't an image%3C/div%3E%22 )%0A            return false;%0A        %7D%0A
         

Check if it is not an image