In your server validation use spans like this:
<span id="mensaje_ServerError">el código de la imagen es incorrecto</span>
Give it an id that is = "FieldName_ServerError"
Then it will convert the server error to a jquery html5 validation error when the page loads and it will work with your existing code.