Add timeout argument to query_specobj and query_photoobj