Trying to fix the loop break border values
Now displaying an error when a phash is null and abort database insertion