getClosestCenter now rejects bad images

returns -1 when bad image